Skip to content

Fix connection pool slot leak on COMMIT failure - #546

Merged
staticlibs merged 1 commit into
duckdb:mainfrom
staticlibs:commit_throw
Aug 7, 2026
Merged

Fix connection pool slot leak on COMMIT failure#546
staticlibs merged 1 commit into
duckdb:mainfrom
staticlibs:commit_throw

Conversation

@staticlibs

Copy link
Copy Markdown
Member

It was discovered that when server COMMIT or ROLLBACK throws, the pool connection tied to the current transaction is not returned to pool.

This PR adds exception checks to those code paths.

Testing: new test is added that covers failures of both COMMIT and ROLLBACK.

Fixes: #545

It was discovered that when server `COMMIT` or `ROLLBACK` throws, the
pool connection tied to the current transaction is not returned to pool.

This PR adds exception checks to those code paths.

Testing: new test is added that covers failures of both `COMMIT` and
`ROLLBACK`.

Fixes: duckdb#545

Co-Authored-By: Shadab Khan <shadabkhan127@gmail.com>
@staticlibs
staticlibs merged commit 4975792 into duckdb:main Aug 7, 2026
7 checks passed
@staticlibs
staticlibs deleted the commit_throw branch August 7, 2026 08:37
staticlibs added a commit that referenced this pull request Aug 7, 2026
This is a backport of the PR #546 to `v1.5-variegata` stable branch.

It was discovered that when server `COMMIT` or `ROLLBACK` throws, the
pool connection tied to the current transaction is not returned to pool.

This PR adds exception checks to those code paths.

Testing: new test is added that covers failures of both `COMMIT` and
`ROLLBACK`.

Fixes: #545

Co-Authored-By: Shadab Khan <shadabkhan127@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connection pool slot is leaked when PostgresTransactionManager::CommitTransaction throws (e.g. server-side connection drop)

1 participant