We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7801166 commit e94b0a5Copy full SHA for e94b0a5
internal/pool/pool.go
@@ -627,7 +627,13 @@ func (p *ConnPool) Put(ctx context.Context, cn *Conn) {
627
628
func (p *ConnPool) Remove(_ context.Context, cn *Conn, reason error) {
629
p.removeConnWithLock(cn)
630
- p.freeTurn()
+
631
+ // Only free a turn if the connection was actually pooled
632
+ // This prevents queue imbalance when removing connections that weren't obtained through Get()
633
+ if cn.pooled {
634
+ p.freeTurn()
635
+ }
636
637
_ = p.closeConn(cn)
638
639
// Check if we need to create new idle connections to maintain MinIdleConns
0 commit comments