Clarify docs for atexit behavior when using ray.kill (#12807)

This commit is contained in:
Edward Oakes
2020-12-11 21:45:39 -06:00
committed by GitHub
parent 1ce745cf44
commit 6262ee1f76
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -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
+3 -2
View File
@@ -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.