Use process reaper for cleanup (#6253)

This commit is contained in:
Edward Oakes
2019-11-26 22:00:08 -06:00
committed by GitHub
parent 8622559e0c
commit e4f9b3b7d9
9 changed files with 172 additions and 53 deletions
+11 -3
View File
@@ -724,9 +724,13 @@ def init(address=None,
)
# Start the Ray processes. We set shutdown_at_exit=False because we
# shutdown the node in the ray.shutdown call that happens in the atexit
# handler.
# handler. We still spawn a reaper process in case the atexit handler
# isn't called.
_global_node = ray.node.Node(
head=True, shutdown_at_exit=False, ray_params=ray_params)
head=True,
shutdown_at_exit=False,
spawn_reaper=True,
ray_params=ray_params)
else:
# In this case, we are connecting to an existing cluster.
if num_cpus is not None or num_gpus is not None:
@@ -779,7 +783,11 @@ def init(address=None,
load_code_from_local=load_code_from_local,
use_pickle=use_pickle)
_global_node = ray.node.Node(
ray_params, head=False, shutdown_at_exit=False, connect_only=True)
ray_params,
head=False,
shutdown_at_exit=False,
spawn_reaper=False,
connect_only=True)
connect(
_global_node,