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 33c70b2 commit c699a45Copy full SHA for c699a45
internal/pool/pool.go
@@ -441,6 +441,16 @@ func (p *ConnPool) removeConnWithLock(cn *Conn) {
441
}
442
443
func (p *ConnPool) removeConn(cn *Conn) {
444
+ // check idleConns and remove it if present
445
+ for i, c := range p.idleConns {
446
+ if c == cn {
447
+ p.idleConns = append(p.idleConns[:i], p.idleConns[i+1:]...)
448
+ p.idleConnsLen--
449
+ break
450
+ }
451
452
+
453
+ // then check conns and remove it
454
for i, c := range p.conns {
455
if c == cn {
456
p.conns = append(p.conns[:i], p.conns[i+1:]...)
@@ -451,6 +461,7 @@ func (p *ConnPool) removeConn(cn *Conn) {
461
break
462
463
464
465
atomic.AddUint32(&p.stats.StaleConns, 1)
466
467
0 commit comments