Skip to content

Some cleanups to counting in AbstractSearchAsyncAction #126167

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

Merged

Conversation

original-brownbear
Copy link
Member

With batched execution merged, turns out we can inline one single-use method here and deduplicate the counting to zero as well.
Also, this removes a completely outdated comment that doesn't apply anymore since we only use the outstanding ops counter.

With batched execution merged, turns out we can inline one
single-use method here and deduplicate the counting to zero as well.
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Apr 2, 2025

private void onShardResultConsumed() {
successfulOps.incrementAndGet();
// we need to increment successful ops first before we compare the exit condition otherwise if we
Copy link
Member Author

Choose a reason for hiding this comment

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

This comment makes no sense at this point, there is no total ops counter anymore.

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.

Nice cleanups and consolidating some duplicate code. Just one minor question.

@original-brownbear
Copy link
Member Author

Thanks Ben!

@original-brownbear original-brownbear merged commit 1ac5178 into elastic:main Apr 21, 2025
17 checks passed
@original-brownbear original-brownbear deleted the some-counting-cleanup branch April 21, 2025 15:52
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