From 81d4a09e177d6671442f95f7c789dbcf3b27b359 Mon Sep 17 00:00:00 2001 From: cyningsun Date: Sun, 23 Jul 2023 11:11:38 +0800 Subject: [PATCH] free turn when leave with error --- internal/pool/pool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/pool/pool.go b/internal/pool/pool.go index bb9b14beb..8672bd5b3 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -256,6 +256,7 @@ func (p *ConnPool) Get(ctx context.Context) (*Conn, error) { p.connsMu.Unlock() if err != nil { + p.freeTurn() return nil, err }