What is the impact of database idle timeouts on HikariCP pool stability?
0 reputation · 18 Apr 2025, 02:32 UTC
Bitbucket Server utilizes HikariCP for JDBC connection pooling, with a default maximum-pool-size of 10. The pool manages connection lifecycles through background eviction and idle timeouts to ensure resource efficiency.
A potential conflict arises when the database server's own idle timeout is configured to be shorter than the application's eviction interval. If the database closes a connection before HikariCP identifies it as idle, the application may attempt to use a stale connection, potentially leading to intermittent connection errors or pool exhaustion during peak load.
Given the default behaviors in Bitbucket Server 8.x, what is the recommended relationship between the database-side timeout and the spring.datasource.hikari.idle-timeout setting to prevent unexpected connection closures? Does the pool automatically recover from these closures without impacting request latency?