[core] Enabling Remote Task Cancelation (#8225)

This commit is contained in:
ijrsvt
2020-05-04 15:24:22 -07:00
committed by GitHub
parent 6c2b9a4cfa
commit cc7bd6650a
9 changed files with 86 additions and 6 deletions
+2 -3
View File
@@ -1679,7 +1679,7 @@ def kill(actor):
def cancel(object_id, force=False):
"""Cancels a locally-submitted task according to the following conditions.
"""Cancels a task according to the following conditions.
If the specified task is pending execution, it will not be executed. If
the task is currently executing, the behavior depends on the ``force``
@@ -1698,8 +1698,7 @@ def cancel(object_id, force=False):
force (boolean): Whether to force-kill a running task by killing
the worker that is running the task.
Raises:
ValueError: This is also raised for actor tasks, already completed
tasks, and non-locally submitted tasks.
TypeError: This is also raised for actor tasks.
"""
worker = ray.worker.global_worker
worker.check_connected()