mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 23:09:51 +08:00
Use process reaper for cleanup (#6253)
This commit is contained in:
+11
-3
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user