Skip to content
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

Cancel search request when its underlying connection gets closed #43105

Closed
javanna opened this issue Jun 11, 2019 · 3 comments · Fixed by #43332
Closed

Cancel search request when its underlying connection gets closed #43105

javanna opened this issue Jun 11, 2019 · 3 comments · Fixed by #43332
Labels
>enhancement >feature :Search/Search Search-related issues that do not fall into other categories

Comments

@javanna
Copy link
Member

javanna commented Jun 11, 2019

Every search request is associated with an internal task that can be found through the list tasks API. Such task can be cancelled and throughout the execution of a search request we make the best effort of stopping it whenever the corresponding parent task has been cancelled by calling the cancel task API.

From a user perspective, cancelling a query could be made easier. One has to call list tasks, find out which task is associated with which query, which involves listing the tasks from each node in the cluster. Once the task has been found, the cancel task API can be called providing the task id as argument.

A way to simplify cancelling queries would be to detect whenever the underlying connection gets closed, which is what happens when a request times out on the client side, and pro-actively cancel the corresponding task. There would be no additional calls required, and queries would get cancelled automatically which would improve things on the server-side too as we would no longer rely on users to remember that they have to cancel their queries.

@javanna javanna added >feature >enhancement :Search/Search Search-related issues that do not fall into other categories 7x labels Jun 11, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@n0othing
Copy link
Member

Is this closed by #43332?

@jimczi
Copy link
Contributor

jimczi commented Dec 16, 2019

Resolved by #43332, thanks @n0othing !

@jimczi jimczi closed this as completed Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement >feature :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants