You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Idle connections evicted from Druid pool do not close underlying MySQL physical connections; orphan physical connections persist after app shutdown #6664
When Druid connection pool evicts idle connections, only the connection object is removed from the pool, but the underlying physical TCP connection to MySQL remains open. I expect the physical database connection to be closed simultaneously when the idle connection gets evicted from the pool.
Additionally, there is an inconsistent behavior on application shutdown:
Right after the application starts, if I stop the program, all physical MySQL connections get closed properly.
However, after the application runs for a period of time, leftover physical MySQL connections can no longer be terminated when stopping the service.
My analysis: This issue occurs because those connections have already been evicted out of the pool beforehand. Logically, all physical MySQL connections belonging to the application should be fully closed once the application process exits, regardless of whether they were evicted from the pool earlier.
This should probably be covered at both eviction and shutdown boundaries. A regression test with a fake or instrumented physical connection could assert that idle eviction calls the underlying close path exactly once, and that application shutdown does not leave the same physical MySQL connection open after the pool object is gone.
Activity
hiSandog commentedon Jul 8, 2026
This should probably be covered at both eviction and shutdown boundaries. A regression test with a fake or instrumented physical connection could assert that idle eviction calls the underlying close path exactly once, and that application shutdown does not leave the same physical MySQL connection open after the pool object is gone.
fix(pool): close physical connection when evicting idle connections