-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconnect after db reboot not possible #1056
Comments
@giselher9 This is caused by unacknowledged TCP -- and TCP connections that never entered the FIN /FINACK state. The fix for this is two fold. The first part is to ensure that socketTimeout is configured. Be careful with this, The second part is not yet possible. The PostgreSQL driver does not currently support Either way, the global |
Just to save the trouble of scanning through the PostgreSQL driver release notes, the |
And to further save trouble searching for an answer on configuring these properties, use something like the following: spring:
datasource:
hikari:
connection-timeout: 10000
idle-timeout: 10000
pool-name: foobar
max-lifetime: 120000
maximum-pool-size: 10
minimum-idle: 8
data-source-properties:
currentSchema: foobar
networkTimeout: 120000
socketTimeout: 60 See also https://www.theguardian.com/info/2019/dec/02/faster-postgresql-connection-recovery. NB: the above shouldn't be considered recommended values. YMMV. |
We have applications, which were not able to reconnect to the db, after the db server has been rebooted during an outage (lasted several hours).
Problem: Applications only reconnected after application restart.
We got the following exception:
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: HikariPool-2 - Connection is not available, request timed out after 10000ms.
When we turn down the db instance in a friendly way, applications reconnect at once, after we restart the db instance.
So, do we miss any configuration or other hints?
Environment
Config
The text was updated successfully, but these errors were encountered: