Skip to content

Commit 1a0e0c9

Browse files
authored
Correct connection pooling accounting (#260)
fixes #259 This fixes a connection pooling bug that would permanently remove a connection from the pool if it's idle timeout expired. This effectively reduced the pools concurrency by one every time an idle timeout was reached.
1 parent 5566fb6 commit 1a0e0c9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

internal/client/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ func (p *Client) release(conn *transactableConn, err error) error {
244244
connChan <- conn
245245
case <-time.After(timeout):
246246
connChan <- nil
247+
p.potentialConns <- struct{}{}
247248
if e := conn.Close(); e != nil {
248249
log.Println("error while closing idle connection:", e)
249250
}

0 commit comments

Comments
 (0)