From f8a6ed7832bbd9e5d2b3e30b5c3f17348bef2405 Mon Sep 17 00:00:00 2001 From: Edward Oakes Date: Fri, 25 Oct 2019 13:01:35 -0700 Subject: [PATCH] Spawn processes in background sessions (#6008) Allows us to properly handle KeyboardInterrupts in interactive python interpreters. --- python/ray/services.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ray/services.py b/python/ray/services.py index e47717f0e..3cb7474d1 100644 --- a/python/ray/services.py +++ b/python/ray/services.py @@ -442,7 +442,8 @@ def start_ray_process(command, env=modified_env, cwd=cwd, stdout=stdout_file, - stderr=stderr_file) + stderr=stderr_file, + preexec_fn=os.setsid) return ProcessInfo( process=process,