Skip to content
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

Active connection not released #2236

Closed
joveth1 opened this issue Sep 12, 2024 · 2 comments
Closed

Active connection not released #2236

joveth1 opened this issue Sep 12, 2024 · 2 comments

Comments

@joveth1
Copy link

joveth1 commented Sep 12, 2024

I'm using springboot 2.3.12 with HikariCP 3.4.5 and my databse is postgresql

My project runs well before. But one day it throws exception:

HikariPool-1 - Connection is not available, request timed out after 30001ms

Then I restarted it, but after some hours or few days, the exception comes again.

I opend the hikari debug logs, and saw that,after some hours the active connections still not released, like this(I have observe two hours the active connections grews to 9):

HikariPool-1 - Pool stats (total=30, active=9, idle=21, waiting=0)

So I guess when all the connections are actived, the exception comes.

My config was:

spring.datasource.hikari.minimum-idle=30
spring.datasource.hikari.maximum-pool-size=30
spring.datasource.hikari.keepalive-time=60000
spring.datasource.hikari.max-lifetime=900000
spring.datasource.hikari.connection-timeout=5000
spring.datasource.hikari.connection-test-query=SELECT 1

I don't why, or maybe there is something wrong in the network model.

@DmitryShabalin
Copy link

maybe it relates with #2253

@brettwooldridge
Copy link
Owner

Upgrade to v6, ensure socketTimeout is configured for the driver, and ensure that keepAlive is configured for the driver (not the same as the HikariCP keepAlive setting). See main page for setting keepAlive at the OS-level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants