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

Task cancellation should use same TCP channel as request to be cancelled #92532

Open
DaveCTurner opened this issue Dec 22, 2022 · 1 comment
Open
Labels
>bug :Distributed/Task Management Issues for anything around the Tasks API - both persistent and node level. Team:Distributed Meta label for distributed team

Comments

@DaveCTurner
Copy link
Contributor

When a parent task is cancelled we use the internal:admin/tasks/ban action to notify all its descendant tasks to stop running too. It's important that the cancellation request arrives after the request that started the descendant task: if the cancellation arrives first then it will appear to be trivial, so it will complete immediately and be forgotten, and then the arrival of the request will start the supposedly-cancelled task.

Today we track child tasks for each Transport.Connection, and make sure to send the cancellation request out over the same Transport.Connection as the original request. A Transport.Connection represents a bundle of TCP channels to a remote node, and this does not give the ordering guarantee needed. I think we need to use the same individual TCP channel for the cancellation. It's ok if this channel is closed, because in that case #56620 will already have cancelled the child task.

@DaveCTurner DaveCTurner added >bug :Distributed/Task Management Issues for anything around the Tasks API - both persistent and node level. labels Dec 22, 2022
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team label Dec 22, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/Task Management Issues for anything around the Tasks API - both persistent and node level. Team:Distributed Meta label for distributed team
Projects
None yet
Development

No branches or pull requests

2 participants