Skip to content

Task Cancellation Enhancements #67505

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

Closed
Bukhtawar opened this issue Jan 14, 2021 · 5 comments
Closed

Task Cancellation Enhancements #67505

Bukhtawar opened this issue Jan 14, 2021 · 5 comments
Labels
:Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination.

Comments

@Bukhtawar
Copy link
Contributor

Problem

  1. The task cancellation results in a ban on child tasks and marking the task cancelled in the task manager, however if the child tasks continue to run without checking on the cancellation(it does so at some points) via CancellableTask#isCancelled, the list task API continues to show the task on the task manager without an indication of whether the task/child task was cancelled, though it might eventually fail/abort.
  2. The cancellation task API supports cancellation of tasks via actions/nodes. It might be good to have a bulk task cancellation API based on task ids, which might be based on task running time etc
@Bukhtawar Bukhtawar added >enhancement needs:triage Requires assignment of a team area label labels Jan 14, 2021
@DaveCTurner DaveCTurner added :Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. and removed needs:triage Requires assignment of a team area label labels Jan 14, 2021
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jan 14, 2021
@elasticmachine
Copy link
Collaborator

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

@DaveCTurner
Copy link
Contributor

I can see some value in the first idea although really IMO it's a bug not to check for cancellation frequently enough for this to matter.

For (2) I much prefer the more recent approach that lets a client cancel its own tasks by disconnecting. Permitting a user to cancel another user's tasks, or even some internal system tasks, is problematic, and letting them cancel tasks in bulk is just scaling up the problem.

@DaveCTurner
Copy link
Contributor

See #51628 for info on the planned future direction of the tasks APIs, and note in particular that we have decided to implement dedicated cancellation APIs on a case-by-case basis rather than rely on the general-purpose task cancellation API.

@DaveCTurner
Copy link
Contributor

A user raised with me that this first suggestion (plus #17094) would be particularly useful with force-merging. Today there's no way to cancel a force-merge on a shard but we can at least indicate in the UI that it's been cancelled while you're waiting and therefore that we won't start any further per-shard work.

@DaveCTurner
Copy link
Contributor

Closing this in favour of #72907.

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

No branches or pull requests

3 participants