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
pool: prevent trimming the last idle connection under load
Previously, the inactivity timer could terminate idle connections even
when doing so left the pool effectively empty. Under heavy load or after inactivity for a few minutes, this
forced the pool to create new connections, causing extra overhead and
occasional TimeoutErrors during acquire().
This change adds a guard in PoolConnectionHolder so that idle
deactivation only happens when it is safe:
- never below pool min_size
- never if there are waiters
- never removing the last idle connection
This ensures the pool retains at least one ready connection and avoids
spurious connection after minutes of inactivity or heavy loads.
0 commit comments