From d0125d4212a11873b6be33edb16ace6ab342f6e2 Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Sat, 7 Sep 2019 15:51:09 -0700 Subject: [PATCH] Fix log monitor process error when attempting to read raylet PID. (#5655) --- python/ray/log_monitor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/ray/log_monitor.py b/python/ray/log_monitor.py index a8fce2fb1..37239950e 100644 --- a/python/ray/log_monitor.py +++ b/python/ray/log_monitor.py @@ -88,8 +88,9 @@ class LogMonitor(object): file_info.file_handle = None try: # Test if the worker process that generated the log file - # is still alive. - os.kill(file_info.worker_pid, 0) + # is still alive. Only applies to worker processes. + if file_info.worker_pid != "raylet": + os.kill(file_info.worker_pid, 0) except OSError: # The process is not alive any more, so move the log file # out of the log directory so glob.glob will not be slowed