Rider 2024.2 database tools: connection keep-alive and idle timeout options after migrating data sources
0 reputation · 25 Feb 2021, 07:42 UTC
0 reputation · 25 Feb 2021, 07:42 UTC
I want to keep Rider's built-in Database tool window reliably connected to a remote PostgreSQL instance during long editing sessions, after moving an existing data source configuration from Rider 2023.3 to 2024.2. The IDE's database tools are based on the JetBrains DataGrip engine, and I am trying to understand which documented settings govern idle connection behavior rather than guessing.
The data source works initially, but after the IDE sits idle, the next query or schema refresh appears to stall or require a reconnect. I am unsure whether this is controlled by Rider itself (for example the auto-disconnect and keep-alive options on the data source Options tab), by the JDBC driver's socket/timeout properties, or by server-side idle session limits. I also do not know whether the 2024.x releases changed any defaults in this area compared with 2023.3, so previously tuned settings may no longer behave the same.
Ideally I would like to verify behavior with Rider's database log output rather than trial and error.
35275 reputation · 25 Feb 2021, 10:30 UTC
The idle‑connection behavior in Rider 2024.2 is controlled by three independent layers:
Auto-disconnect after (seconds) and Run keep-alive query each (seconds) on the Options tab.socketTimeout, loginTimeout, and optional idleTimeout set on the Advanced tab as JDBC URL parameters.idle_in_transaction_session_timeout, tcp_keepalives_idle, etc.Auto-disconnect after defaults to 0 (disabled). When set to a positive value, Rider closes the connection after that many seconds of inactivity and logs a message like "Closing idle connection to PostgreSQL due to auto-disconnect".Run keep-alive query each defaults to empty (disabled). When a query (e.g., SELECT 1) and interval are supplied, Rider sends that SQL at the interval and logs "Executing keep-alive query: SELECT 1".socketTimeout=0 (infinite), loginTimeout=0, and no idleTimeout unless explicitly added. Changing these values requires reconnecting the data source (or restarting Rider) for them to take effect.If the stall occurs after a period of IDE inactivity and the log shows neither an auto‑disconnect nor a keep‑alive entry, followed by a JDBC communications error, the termination is most likely server‑side (PostgreSQL idle timeout or TCP keepalive) or caused by a JDBC socketTimeout that was not overridden. Conversely, if you see an auto‑disconnect log entry just before the stall, the client‑side Rider setting is the cause.
Auto-disconnect after and Run keep-alive query each.idea.log file visible.Auto-disconnect after = 300 seconds (5 min)Run keep-alive query each = SELECT 1 every 60 secondsidea.log:
socketTimeout (e.g., add ?socketTimeout=0 to the URL) and reconnect.We need to know the approximate idle period after which the stall occurs (e.g., 2 minutes, 10 minutes, 30 minutes). If the stall happens well before any reasonable Rider auto‑disconnect value you might set, the cause is almost certainly server‑side or JDBC; if it aligns with a specific interval you can tune, adjusting Rider’s auto‑disconnect or keep‑alive is the direct fix.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.