Skip to content

Cancel pool connection timeout timer when acquisition fails - #1713

Merged
tsegismont merged 2 commits into
eclipse-vertx:4.xfrom
goutamadwant:fix/pool-execute-timer-on-acquire-failure-4.x
Oct 8, 2026
Merged

tsegismont merged 2 commits into
eclipse-vertx:4.xfrom
goutamadwant:fix/pool-execute-timer-on-acquire-failure-4.x

Conversation

@goutamadwant

@goutamadwant goutamadwant commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Backport #1712

See #1706. On 4.x the double completion surfaces as IllegalStateException: Result is already complete, thrown either by the pool timer after a failed connection attempt or by the connect path when the timeout fired first.

Tests:

  • SqlConnectionPoolTest.testConnectFailureCancelsConnectionTimeout
  • SqlConnectionPoolTest.testConnectFailureAfterConnectionTimeout

@vietj vietj added this to the 4.5.35 milestone Sep 28, 2026
@vietj vietj modified the milestones: 4.5.35, 4.5.36 Oct 7, 2026
See eclipse-vertx#1706

When a pooled query fails to acquire a connection, the connection timeout
timer is not cancelled, so it fails the query promise again when it fires
and reports "IllegalStateException: Result is already complete". When the
timer fires first, the acquisition failure fails the promise again with the
same exception.

Handle the acquisition failure like a successful acquisition: cancel the
timer, and if it already fired, do not fail the promise again.

Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
@tsegismont
tsegismont force-pushed the fix/pool-execute-timer-on-acquire-failure-4.x branch from 9e5283d to 313ed29 Compare October 8, 2026 13:15

@tsegismont tsegismont left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @goutamadwant

@tsegismont
tsegismont merged commit 4015e58 into eclipse-vertx:4.x Oct 8, 2026
18 checks passed
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.

3 participants