From 3adc8ad86f27a1e3170257fdfa1ac479093e1d56 Mon Sep 17 00:00:00 2001 From: Daniil Aksenov Date: Sat, 21 Dec 2024 18:52:38 +0300 Subject: [PATCH] fix context which is used for closing session --- CHANGELOG.md | 2 ++ internal/pool/pool.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d18c67fa..e86001f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Fixed connections pool leak on closing sessions + ## v3.95.3 * Supported of `database/sql/driver.Valuer` interfaces for params which passed to query using sql driver * Exposed `credentials/credentials.OAuth2Config` OAuth2 config diff --git a/internal/pool/pool.go b/internal/pool/pool.go index fcb1234d4..00eb387c1 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -302,7 +302,7 @@ func makeAsyncCloseItemFunc[PT ItemConstraint[T], T any]( defer closeItemCancel() if d := p.config.closeTimeout; d > 0 { - closeItemCtx, closeItemCancel = xcontext.WithTimeout(ctx, d) + closeItemCtx, closeItemCancel = xcontext.WithTimeout(closeItemCtx, d) defer closeItemCancel() }