From 54bc0ed363c4ed6824b2f2949422857d9fcb4af7 Mon Sep 17 00:00:00 2001 From: Qiyuan Gong Date: Thu, 10 Dec 2020 18:21:47 +0800 Subject: [PATCH] Fix macOS ZombieProcess Exception (#3221) * Fix macOS ZombieProcess * Add ProcessLookupError catch --- python/orca/src/bigdl/orca/ray/raycontext.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/orca/src/bigdl/orca/ray/raycontext.py b/python/orca/src/bigdl/orca/ray/raycontext.py index 959d411bbc0..ba5e159c8ad 100755 --- a/python/orca/src/bigdl/orca/ray/raycontext.py +++ b/python/orca/src/bigdl/orca/ray/raycontext.py @@ -72,13 +72,13 @@ def kill_redundant_log_monitors(redis_address): is_same_redis = "--redis-address={}".format(redis_address) if is_log_monitor and is_same_redis in cmdline: log_monitor_processes.append(proc) - except psutil.AccessDenied: - # psutil may encounter AccessDenied exceptions - # when it's trying to visit core services + except (psutil.AccessDenied, psutil.ZombieProcess, psutil.ProcessLookupError): + # psutil may encounter AccessDenied or ZombieProcess exceptions + # when it's trying to visit some MacOS core services if psutil.MACOS: continue else: - raise + raise Exception("List process with list2cmdline failed!") if len(log_monitor_processes) > 1: for proc in log_monitor_processes[1:]: