Skip to content

Fail acquisition with the hook failure and release the lease when aft…#1684

Open
andrewkav wants to merge 1 commit into
eclipse-vertx:masterfrom
andrewkav:fix/pool-acquire-hook-failure-cleanup
Open

Fail acquisition with the hook failure and release the lease when aft…#1684
andrewkav wants to merge 1 commit into
eclipse-vertx:masterfrom
andrewkav:fix/pool-acquire-hook-failure-cleanup

Conversation

@andrewkav

Copy link
Copy Markdown

When the afterAcquire hook failed during SqlConnectionPool#acquire, the acquisition was failed with the enclosing (null) failure instead of the hook failure, so callers observed a null cause. The lease was also neither recycled nor closed, leaking the pool slot: with enough hook failures the pool starved with no way to recover.

Recycle the lease and fail the acquisition with the actual hook failure.

Motivation:

Explain here the context, and why you're making that change, what is the problem you're trying to solve.

Conformance:

You should have signed the Eclipse Contributor Agreement as explained in https://github.com/eclipse/vert.x/blob/master/CONTRIBUTING.md
Please also make sure you adhere to the code style guidelines: https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines

…erAcquire fails

When the afterAcquire hook failed during SqlConnectionPool#acquire,
the acquisition was failed with the enclosing (null) failure instead
of the hook failure, so callers observed a null cause. The lease was
also neither recycled nor closed, leaking the pool slot: with enough
hook failures the pool starved with no way to recover.

Recycle the lease and fail the acquisition with the actual hook
failure.

Signed-off-by: andrei <andrei@n2.games>
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.

2 participants