mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 12:45:44 +08:00
Clarify docs for atexit behavior when using ray.kill (#12807)
This commit is contained in:
@@ -1007,6 +1007,7 @@ def exit_actor():
|
||||
"""Intentionally exit the current actor.
|
||||
|
||||
This function is used to disconnect an actor and exit the worker.
|
||||
Any ``atexit`` handlers installed in the actor will be run.
|
||||
|
||||
Raises:
|
||||
Exception: An exception is raised if this is a driver or this
|
||||
|
||||
@@ -1533,11 +1533,12 @@ def kill(actor, *, no_restart=True):
|
||||
"""Kill an actor forcefully.
|
||||
|
||||
This will interrupt any running tasks on the actor, causing them to fail
|
||||
immediately. Any atexit handlers installed in the actor will still be run.
|
||||
immediately. ``atexit`` handlers installed in the actor will not be run.
|
||||
|
||||
If you want to kill the actor but let pending tasks finish,
|
||||
you can call ``actor.__ray_terminate__.remote()`` instead to queue a
|
||||
termination task.
|
||||
termination task. Any ``atexit`` handlers installed in the actor *will*
|
||||
be run in this case.
|
||||
|
||||
If the actor is a detached actor, subsequent calls to get its handle via
|
||||
ray.get_actor will fail.
|
||||
|
||||
Reference in New Issue
Block a user