Skip to content

Commit

Permalink
Fix connection picker regression
Browse files Browse the repository at this point in the history
  • Loading branch information
glutamatt committed Sep 9, 2024
1 parent 3a1e987 commit 7e33298
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions connectionpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,4 +551,5 @@ func (pool *hostConnPool) HandleError(conn *Conn, err error, closed bool) {
}

pool.connPicker.Remove(conn)
go pool.fill()
}
5 changes: 3 additions & 2 deletions connpicker.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ func (p *defaultConnPicker) Remove(conn *Conn) {

for i, candidate := range p.conns {
if candidate == conn {
p.conns[i] = nil
return
last := len(p.conns) - 1
p.conns[i], p.conns = p.conns[last], p.conns[:last]
break
}
}
}
Expand Down

0 comments on commit 7e33298

Please sign in to comment.