Skip to content

Fix HTTP client close hook leak - #6271

Open
arnabnandy7 wants to merge 1 commit into
eclipse-vertx:masterfrom
arnabnandy7:fix/http-client-close-hook-leak
Open

Fix HTTP client close hook leak#6271
arnabnandy7 wants to merge 1 commit into
eclipse-vertx:masterfrom
arnabnandy7:fix/http-client-close-hook-leak

Conversation

@arnabnandy7

Copy link
Copy Markdown

Motivation:

HTTP clients created with httpClientBuilder() register their internal closeable with the creating context's CloseFuture. Explicitly closing a client did not remove this hook, causing the context to retain the closed client and its resources for the context's lifetime.

This change removes the hook when the underlying HTTP client's close future completes. It also adds a regression test verifying that an explicitly closed client is detached from the context's CloseFuture.

Fixes #6268.

Conformance:

I have signed the Eclipse Contributor Agreement and adhered to the Vert.x code style guidelines.

Testing:

mvn -pl vertx-core '-Dtest=io.vertx.tests.vertx.VertxTest#testCloseHttpClientRemovesCloseHook' test

Result: 1 test run, 0 failures, 0 errors.

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.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.

Closed HttpClient is never removed from the context CloseFuture, leaking every client built with HttpClientBuilder

1 participant