Merged
Conversation
…the test. Motivation: The recent addition of VertxTestBase stateless assertion reports introduced a leak in tests when test keep references to cleanable vertx objects. The CleanerImpl was maintaining a path of strong references to the instances of VertxTestBase, when such instance keeps a strong ref to a cleanable object, this prevents the cleanable object to be reclaimed and thus prevents the cleaner to execute cleanable actions. Changes: VertxTestBase bridge handler now keeps a weak ref to the test instead of a strong ref.
Motivation: VertxImpl maintains a map of timeouts that should be cleared when an instance is closed and executors have been shutdown. Durint the testsuite execution, this maps can maintain references to handlers set during the test suite execution and it can maintain strong references to the test. Often the test maintains references to cleanable object leading to preventing GC do its job. Changes: Clear the VertxImpl#timeouts on close.
…lean. Motivation: Cleanable vertx actions keep a reference to the underlying resource to close so they can release it when the cleanable action is executed. It is expectable that a reference is kept to the Cleanable resource and call close on it, in such situation the resource is effectively closed but the action still keep a reference to this resource. Changes: When cleanable action is executed, clear the reference to the resource.
…ployment and instead should rely on the deployement ID. Motivation: Verticle context have a reference to the deployment which references the verticle class and its reachables. When a verticle is undeployed Verticle contexts can be hold somewhere, e.g. a timer. Changes: Context implementation now keeps only the deployment ID and will use it to provide relevant deployment objects.
5746ffa to
009804e
Compare
…ull after shutdown. Motivation: When a Cleanable object is shutdown, it should not keep a reference to the cleanable and its action since those have been executed. That avoids keeping references to them when the Cleanable object reference is kept. Changes: Cleanable object on shutdown sets the cleanable+action to null.
Motivation: CleanableHttpClient and CleanableNetClient both share the same code for implementing cleanable clients. We should have a single implementation of this. Changes: Merge cleaner usage of CleanableHttpClient and CleanableNetClient in a base CleanableObject.
Motivation: Vert.x implements sticky event-loop using a thread local with a weak reference of the event-loop. We can achieve a similar effect using an array of event-loop indexed by the thread id. Changes: Remove the usage of thread local for sticky event-loop and replace it by a power of 2 length array that is indexed by the thread id.
Motivation: VertxThread keeps a reference to its owner to be able to distinguish if a vertx thread is related to a particular vertx instance. This can be achieved by using the system identity hashcode instead. Changes: Keep the value of the owner identity hashcode instead of the vertx instance.
506d77b to
b2fdb5e
Compare
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.
Various leak fixes related to how Vert.x handle cleanable objects.