mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 03:25:27 +08:00
[core] Enabling Remote Task Cancelation (#8225)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user