HikariCP icon indicating copy to clipboard operation
HikariCP copied to clipboard

Apparent connection leak detected error

Open justinsumida opened this issue 1 year ago • 1 comments

We recently converted to Spring Boot 3 as a major upgrade and switched from Tomcat to Hikari. We are currently running load tests and are noticing a large change in the 99th percentile of overall response time to our web service.

One thing we notice is a lot of Apparent connection leak errors, we have the leak detection threshold set at 5 seconds right now to diagnose troubles. Our Oracle DBE reported no queries taking close to 5 seconds from his perspective in OEM.

With a major upgrade, it can very well be another issue, but with the disconnect between a leak detection to OEM reporting fast queries, Hikari is our lead we are chasing. Is there a reason that we could be seeing such long connection times?

Our current settings look like this:

registerMbeans: true
maximum-pool-size: 20
connection-timeout: 30000 # 30 seconds
idle-timeout: 600000 # 10 minutes
max-lifetime: 1800000 # 30 minutes
leak-detection-threshold: 5000 # 5 seconds
data-source-properties:
  oracle:
    jdbc:
      defaultConnectionValidation: LOCAL
  socketTimeout: "30"

Any help here would be appreciated.

justinsumida avatar Aug 07 '24 20:08 justinsumida

The provided stack hints where the Connection has been acquired, hinting where it should be closed. You may monitor yourself this timing (between .getConnection() and .close() ), to investigate in which case the connection remains open for too long.

blacelle avatar Nov 14 '25 10:11 blacelle