Minor improvements and fixes in Python code. (#3022)

This commit fix some small defects. 
1. Remove a comment that should have been removed in #3003
2. Remove `redis_protected_mode` that is never used in `ray.init()`
3. Fix `object_id_seed` that is forgotten to be passed into `ray._init()`
4. Remove several redundant brackets.
This commit is contained in:
Si-Yuan
2018-10-03 21:08:20 -07:00
committed by Robert Nishihara
parent 9948e8c11b
commit f2dbd3096c
3 changed files with 29 additions and 32 deletions
+6 -3
View File
@@ -187,18 +187,21 @@ def cleanup():
logger.warning("Ray did not shut down properly.")
def all_processes_alive(exclude=[]):
def all_processes_alive(exclude=None):
"""Check if all of the processes are still alive.
Args:
exclude: Don't check the processes whose types are in this list.
"""
if exclude is None:
exclude = []
for process_type, processes in all_processes.items():
# Note that p.poll() returns the exit code that the process exited
# with, so an exit code of None indicates that the process is still
# alive.
processes_alive = [p.poll() is None for p in processes]
if (not all(processes_alive) and process_type not in exclude):
if not all(processes_alive) and process_type not in exclude:
logger.warning(
"A process of type {} has died.".format(process_type))
return False
@@ -358,7 +361,7 @@ def _compute_version_info():
ray_version = ray.__version__
python_version = ".".join(map(str, sys.version_info[:3]))
pyarrow_version = pyarrow.__version__
return (ray_version, python_version, pyarrow_version)
return ray_version, python_version, pyarrow_version
def _put_version_info_in_redis(redis_client):