-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Execute async cleanup tasks in CoordinatorTests #91794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute async cleanup tasks in CoordinatorTests #91794
Conversation
Closing the `JoinValidationService` will enqueue a cache-cleaning task which must be executed to release any pages held by the cache. This commit also introduces a deterministic leak detector to replace the one based on garbage collection, because in these tests we know exactly the expected lifecycle of all allocated pages. Closes elastic#91599 Closes elastic#91379 Closes elastic#90576
|
Pinging @elastic/es-distributed (Team:Distributed) |
kingherc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one comment if you think more tracing might help in the future.
| @Override | ||
| public Recycler.V<byte[]> bytePage(boolean clear) { | ||
| final var page = super.bytePage(clear); | ||
| openPages += 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if log is e.g. TRACE to also capture the thread stack of the pages. That way, if the assertion that there is no page remaining fails, we may be able to inspect which thread stacks created them. I believe this should be cheap for the majority of the tests (since I guess they do not run in TRACE mode) and when a test fails we may easily re-run it with TRACE to figure out leaks.
This is optional if you consider this would be beneficial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer not to do this here, it would mean we can't just use a counter to check for leaks (or we'd have two whole different implementations depending on the log level). I'd rather just add such tracing code as and when it's needed.
|
I'm running some iterations of the |
Closing the `JoinValidationService` will enqueue a cache-cleaning task which must be executed to release any pages held by the cache. This commit also introduces a deterministic leak detector to replace the one based on garbage collection, because in these tests we know exactly the expected lifecycle of all allocated pages. Closes elastic#91599 Closes elastic#91379 Closes elastic#90576
Closing the `JoinValidationService` will enqueue a cache-cleaning task which must be executed to release any pages held by the cache. This commit also introduces a deterministic leak detector to replace the one based on garbage collection, because in these tests we know exactly the expected lifecycle of all allocated pages. Closes elastic#91599 Closes elastic#91379 Closes elastic#90576
Closing the `JoinValidationService` will enqueue a cache-cleaning task which must be executed to release any pages held by the cache. This commit also introduces a deterministic leak detector to replace the one based on garbage collection, because in these tests we know exactly the expected lifecycle of all allocated pages. Closes #91599 Closes #91379 Closes #90576
Closing the `JoinValidationService` will enqueue a cache-cleaning task which must be executed to release any pages held by the cache. This commit also introduces a deterministic leak detector to replace the one based on garbage collection, because in these tests we know exactly the expected lifecycle of all allocated pages. Closes #91599 Closes #91379 Closes #90576
Closing the
JoinValidationServicewill enqueue a cache-cleaning task which must be executed to release any pages held by the cache.This commit also introduces a deterministic leak detector to replace the one based on garbage collection, because in these tests we know exactly the expected lifecycle of all allocated pages.
Closes #91599
Closes #91379
Closes #90576