Skip to content

Commit 990e0ec

Browse files
committed
Fix pool idle connection counter bug
1 parent e9376db commit 990e0ec

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

internal/pool/pool.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ func GetMaintenanceNotificationCallback() func(ctx context.Context, cn *Conn, no
132132
return maintenanceNotificationCallback
133133
}
134134

135-
136135
// Stats contains pool state information and accumulated stats.
137136
type Stats struct {
138137
Hits uint32 // number of times free connection was found in the pool
@@ -948,7 +947,6 @@ func (p *ConnPool) putConn(ctx context.Context, cn *Conn, freeTurn bool) {
948947
p.connsMu.Unlock()
949948
p.idleConnsLen.Add(1)
950949
}
951-
p.idleConnsLen.Add(1)
952950

953951
// Notify metrics: connection moved from used to idle
954952
if connectionStateChangeCallback != nil {

0 commit comments

Comments
 (0)