Skip to content

Remove assertExecuteOnStartThread from AbstractSearchAsyncAction#121922

Merged
original-brownbear merged 1 commit intoelastic:mainfrom
original-brownbear:drop-outdated-assertion
Feb 7, 2025
Merged

Remove assertExecuteOnStartThread from AbstractSearchAsyncAction#121922
original-brownbear merged 1 commit intoelastic:mainfrom
original-brownbear:drop-outdated-assertion

Conversation

@original-brownbear
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor 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 :)).

@elasticsearchmachine
Copy link
Copy Markdown
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 <dimitris.rempapis@elastic.co>
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