mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 11:44:39 +08:00
Suppress excess warning messages related to intentional actor deaths. (#627)
* Don't submit the actor destructor tasks when the job is exiting. * Don't propagate error messages to the driver when an actor exits intentionally.
This commit is contained in:
committed by
Philipp Moritz
parent
d0bfc0a849
commit
a4d8e13094
+4
-2
@@ -279,6 +279,7 @@ def make_actor(Class, num_cpus, num_gpus):
|
||||
# terminating the worker.
|
||||
class Class(Class):
|
||||
def __ray_terminate__(self):
|
||||
ray.worker.global_worker.local_scheduler_client.disconnect()
|
||||
import os
|
||||
os._exit(0)
|
||||
|
||||
@@ -398,8 +399,9 @@ def make_actor(Class, num_cpus, num_gpus):
|
||||
|
||||
def __del__(self):
|
||||
"""Kill the worker that is running this actor."""
|
||||
actor_method_call(self._ray_actor_id, "__ray_terminate__",
|
||||
self._ray_method_signatures["__ray_terminate__"])
|
||||
if ray.worker.global_worker.connected:
|
||||
actor_method_call(self._ray_actor_id, "__ray_terminate__",
|
||||
self._ray_method_signatures["__ray_terminate__"])
|
||||
|
||||
return NewClass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user