Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

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 elastic#91599
Closes elastic#91379
Closes elastic#90576
@DaveCTurner DaveCTurner added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v8.6.1 v8.7.0 v8.5.3 labels Nov 22, 2022
@DaveCTurner DaveCTurner requested a review from kingherc November 22, 2022 11:32
@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Nov 22, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Copy link
Contributor

@kingherc kingherc left a 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;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@DaveCTurner
Copy link
Contributor Author

I'm running some iterations of the CoordinatorTests in the background to see if this causes any problems before merging it.

@DaveCTurner DaveCTurner merged commit 7631500 into elastic:main Nov 22, 2022
@DaveCTurner DaveCTurner deleted the 2022-11-22-fix-CoordinatorTests-leak branch November 22, 2022 14:13
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 22, 2022
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
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 22, 2022
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
elasticsearchmachine pushed a commit that referenced this pull request Nov 22, 2022
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
elasticsearchmachine pushed a commit that referenced this pull request Nov 22, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. >test Issues or PRs that are addressing/adding tests v8.5.3 v8.6.1 v8.7.0

Projects

None yet

3 participants