Skip to content

Commit

Permalink
[Backport] Fix macOS ZombieProcess Exception (#3222)
Browse files Browse the repository at this point in the history
* Fix macOS ZombieProcess
* Add ProcessLookupError catch
  • Loading branch information
qiyuangong authored Dec 10, 2020
1 parent 5e290dc commit d729c26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyzoo/zoo/ray/raycontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:]:
Expand Down

0 comments on commit d729c26

Please sign in to comment.