Skip to content

Fix afterAcquire hook failure leaking connection lease and metrics - #1699

Merged
tsegismont merged 1 commit into
eclipse-vertx:masterfrom
tsegismont:issue/1698
Sep 17, 2026
Merged

tsegismont merged 1 commit into
eclipse-vertx:masterfrom
tsegismont:issue/1698

Conversation

@tsegismont

@tsegismont tsegismont commented Sep 17, 2026

Copy link
Copy Markdown
Member

See #1698

When the afterAcquire hook returns a failed future in SqlConnectionPool.PoolRequest.complete(), the lease is never recycled, dequeueMetric is never called, and the wrong error is propagated.

Extract a fail(lease, cause) helper that recycles the lease, dequeues the metric, and fails the handler. Use it for both the afterAcquire failure path and the existing pool failure path.

Assisted-by: Anthropic Claude (Opus 4.6)

When the afterAcquire hook returns a failed future in SqlConnectionPool.PoolRequest.complete(), the lease is never recycled, dequeueMetric is never called, and the wrong error is propagated.

Extract a fail(lease, cause) helper that recycles the lease, dequeues the metric, and fails the handler. Use it for both the afterAcquire failure path and the existing pool failure path.

Assisted-by: Anthropic Claude (Opus 4.6)
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont tsegismont added this to the 5.2.0 milestone Sep 17, 2026
@tsegismont
tsegismont merged commit d78b14f into eclipse-vertx:master Sep 17, 2026
19 checks passed
@tsegismont
tsegismont deleted the issue/1698 branch September 17, 2026 15:13
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.

1 participant