Skip to content

Clear per-shard failure earlier in AbstractSearchAsyncAction.onShardResult #126933

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

Conversation

original-brownbear
Copy link
Member

We can clean the failure before we potentially go async for a partial merge here to save some heap and needless reference chains to the per-shard result.
Mainly interesting because it makes heap dumps easier to understand by avoiding the circular(ish) reference chains to the result. Also just another small improvement saving a little allocation.

…esult

We can clean the failure before we potentially go async for a partial merge here to save
some heap and needless reference chains to the per-shard result.
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Apr 16, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

Copy link
Contributor

@benchaplin benchaplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

I understand how this removes "needless reference chains" but I don't see how those references might be "circular(ish)" in a heap dump.

@original-brownbear
Copy link
Member Author

Thanks Ben!

The referfence comment came from the fact that we were referencing the result from the Runnable that is then referrenced by QueryPhaseResultConsumer but also from QueryPhaseResultConsumer directly and then the Runnable itself references AbstractSearchAsyncAction which itself references the result consumer :) This needs a bit more cleanup for sure but this is a reasonable start :D

@original-brownbear original-brownbear merged commit 7c3e850 into elastic:main Apr 18, 2025
17 checks passed
@original-brownbear original-brownbear deleted the clear-shard-failure-earlier branch April 18, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport pending >non-issue :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants