Improve cleanable proxies by removing any strong reference to the resource.#6109
Merged
Conversation
…ource. Motivation: Cleanable objects (HttpClient and NetClient) still hold a strong reference to the actual client. Cleanable objects and its cleanable action were still retaining a reference to the actual resource holding it in heap through cleaner reference queue. During the test suite, many vertx instances and associated resources were held in heap because of the cleaner queue. Changes: Cleanable objects now keep a weak reference to the resource instead.
2e9ffef to
3c5a64c
Compare
tsegismont
added a commit
to vert-x3/vertx-dropwizard-metrics
that referenced
this pull request
May 18, 2026
In CI, there was an ISE thrown: Error: io.vertx.ext.dropwizard.tests.MetricsTest.testNetMetricsOnClose -- Time elapsed: 0.012 s <<< ERROR! java.lang.IllegalStateException at io.vertx.core@5.1.0-SNAPSHOT/io.vertx.core.impl.CleanableObject.getOrDie(CleanableObject.java:61) at io.vertx.core@5.1.0-SNAPSHOT/io.vertx.core.net.impl.tcp.CleanableNetClient.getMetrics(CleanableNetClient.java:89) at io.vertx.metrics.dropwizard@5.1.0-SNAPSHOT/io.vertx.ext.dropwizard.impl.AbstractMetrics.unwrap(AbstractMetrics.java:48) at io.vertx.metrics.dropwizard@5.1.0-SNAPSHOT/io.vertx.ext.dropwizard.impl.MetricsServiceImpl.getMetricsSnapshot(MetricsServiceImpl.java:32) at io.vertx.metrics.dropwizard.tests/io.vertx.ext.dropwizard.tests.MetricsTest.testNetMetricsOnClose(MetricsTest.java:796) This was due to the changes in eclipse-vertx/vert.x#6109 In this test, we can use the clientBaseName instead of the client reference. This is functionally equivalent and robust. Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.