From 4408f8cfb2d4b3c49fbb5d17e6dfb85f04ce96c2 Mon Sep 17 00:00:00 2001 From: cyningsun Date: Mon, 30 Oct 2023 23:42:26 +0800 Subject: [PATCH] free turn when leave with error (#2658) Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- internal/pool/pool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/pool/pool.go b/internal/pool/pool.go index f391ceda..986c05d0 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -263,6 +263,7 @@ func (p *ConnPool) Get(ctx context.Context) (*Conn, error) { p.connsMu.Unlock() if err != nil { + p.freeTurn() return nil, err }