-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Make multi search tasks cancellable #44494
Conversation
Today multi search tasks, created through MultiSearchRequest#createTask end up being the default task instance which is not cancellable. With this change we make them a search task, which is cancellable, and also cancels all the sub-tasks when cancelled.
Pinging @elastic/es-search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should work, but I would feel better if we had an integration level test that really checks that we connected all dots here. You can probably modify SearchCancellationIT to randomly wrap it into MultiSearch from time to time.
Turns out that an integration test is needed, and it proves that cancelling msearch requests does not really cancel all the corresponding searches as there are three levels of tasks: msearch -> search -> shard level search . I will work on making cancelling a task work for this scenario, but it will require a separate change. |
This PR can be resumed once #50990 is fixed. |
I removed the stalled label, I will pick this back up shortly given that the tasks framework now supports hierarchical cancellation of tasks. |
This was implemented in #61337 |
Today multi search tasks, created through MultiSearchRequest#createTask
end up being the default task instance which is not cancellable. With
this change we make them a search task, which is cancellable, and also
cancels all the sub-tasks when cancelled.