Change actor.__ray_kill__() to ray.kill(actor) (#7360)

This commit is contained in:
Edward Oakes
2020-02-28 11:55:14 -06:00
committed by GitHub
parent 3fc162f93c
commit 93fe4b0b58
6 changed files with 44 additions and 16 deletions
+4 -12
View File
@@ -783,18 +783,10 @@ class ActorHandle:
self.__ray_terminate__._actor_hard_ref = None
def __ray_kill__(self):
"""Kill the actor that this actor handle refers to immediately.
This will cause any outstanding tasks submitted to the actor to fail
and the actor to exit in the same way as if it crashed. In general,
you should prefer to just delete the actor handle and let it clean up
gracefull.
Returns:
None.
"""
worker = ray.worker.get_global_worker()
worker.core_worker.kill_actor(self._ray_actor_id)
"""Deprecated - use ray.kill() instead."""
logger.warning("actor.__ray_kill__() is deprecated and will be removed"
" in the near future. Use ray.kill(actor) instead.")
ray.kill(self)
@property
def _actor_id(self):