Skip to content
Discussion options

You must be logged in to vote

Root cause: In putConn, when the idle pool is at MaxIdleConns, an evicted connection is removed via removeConnWithLock + closeConn without firing ProcessOnRemove, so OnRemove hooks never run. With Entra ID, ReAuthPoolHook.OnRemove is the only cleanup for per-conn listeners (each holds a *pool.Conn with 64 KiB bufio buffers), so one listener leaks per eviction - ~1:1 with StaleConns, until OOM.

Fix: #3932 fires ProcessOnRemove on the eviction path.

On StaleConns growth: Even with the OOM fixed, ~4.8/s suggests connection churn beyond the leak - MaxIdleConns=5 is small for bursty XReadGroup traffic, so each burst opens connections that get evicted on the next Put. Raising MaxIdleConns (or l…

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ndyakov
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants