Skip to content

Remove assertExecuteOnStartThread from AbstractSearchAsyncAction #121922

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

This is a really strange assertion. I get that it tries to make sure we skip unavailable without forking but this makes extending the AbstractSearchAsyncAction cleanly for batched execution needlessly hard and some of the assertion is dead code already because can-match isn't going through this codepath anymore.

-> lets remove it, the code is simple enough now to follow that there's no forking here IMO

This is a really strange assertion. I get that it tries to make sure we
skip unavailable without forking but this makes extending the
AbstractSearchAsyncAction cleanly for batched execution needlessly hard
and some of the assertion is dead code already because can-match isn't
going through this codepath anymore.

-> lets remove it, the code is simple enough now to follow that there's
no forking here IMO
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Feb 6, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

For the record, the assertion comes from #71580. I agree that it's a weird one. Perhaps we could add a comment to failOnUnavailable to signal that we don't fork its execution as we don't expect recursive calls to it. Maybe that's redundant though, I am not sure myself.

@original-brownbear original-brownbear added the auto-backport Automatically create backport pull requests when merged label Feb 7, 2025
@original-brownbear
Copy link
Member Author

Thanks Luca :) I think there's no need for a comment, maybe we can actually just inline the method own the line (but shortly :)).

@original-brownbear original-brownbear merged commit 2c6dd6c into elastic:main Feb 7, 2025
17 checks passed
@original-brownbear original-brownbear deleted the drop-outdated-assertion branch February 7, 2025 08:36
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Feb 7, 2025
…stic#121922)

This is a really strange assertion. I get that it tries to make sure we
skip unavailable without forking but this makes extending the
AbstractSearchAsyncAction cleanly for batched execution needlessly hard
and some of the assertion is dead code already because can-match isn't
going through this codepath anymore.

-> lets remove it, the code is simple enough now to follow that there's
no forking here IMO
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.0
8.18 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 121922

elasticsearchmachine pushed a commit that referenced this pull request Feb 18, 2025
…1922) (#121998)

This is a really strange assertion. I get that it tries to make sure we
skip unavailable without forking but this makes extending the
AbstractSearchAsyncAction cleanly for batched execution needlessly hard
and some of the assertion is dead code already because can-match isn't
going through this codepath anymore.

-> lets remove it, the code is simple enough now to follow that there's
no forking here IMO

Co-authored-by: Dimitris Rempapis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >non-issue :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v8.18.0 v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants