diff --git a/python/ray/actor.py b/python/ray/actor.py index 5baaf6a9a..73255856d 100644 --- a/python/ray/actor.py +++ b/python/ray/actor.py @@ -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 diff --git a/python/ray/worker.py b/python/ray/worker.py index 306a25465..430f59af2 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -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.