mirror of
https://github.com/wassname/ray.git
synced 2026-07-17 11:32:33 +08:00
Fix some bugs causing Travis test failures. (#839)
* Fix bug in which worker has no actor_class attribute. * Remove case where we check if processes are defunct.
This commit is contained in:
committed by
Philipp Moritz
parent
ca53e9ae7b
commit
cf41964816
@@ -4,7 +4,6 @@ from __future__ import print_function
|
||||
|
||||
import json
|
||||
import os
|
||||
import psutil
|
||||
import redis
|
||||
import time
|
||||
|
||||
@@ -115,18 +114,12 @@ def _pid_alive(pid):
|
||||
pid: The pid to check.
|
||||
|
||||
Returns:
|
||||
This returns false if the process is dead or defunct. Otherwise, it
|
||||
returns true.
|
||||
This returns false if the process is dead. Otherwise, it returns true.
|
||||
"""
|
||||
try:
|
||||
os.kill(pid, 0)
|
||||
except OSError:
|
||||
return False
|
||||
else:
|
||||
if psutil.Process(pid).status() == psutil.STATUS_ZOMBIE:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def wait_for_pid_to_exit(pid, timeout=20):
|
||||
|
||||
Reference in New Issue
Block a user