From e261b4778e18e4d7360c9241f81ef034d5c3c548 Mon Sep 17 00:00:00 2001 From: fangfengbin <869218239a@zju.edu.cn> Date: Thu, 21 May 2020 11:30:28 +0800 Subject: [PATCH] Adjust the state initialization sequence and put it after core worker google logging initialization (#8511) --- python/ray/worker.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/ray/worker.py b/python/ray/worker.py index 17b8adb1c..40b4d7081 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -1194,10 +1194,6 @@ def connect(node, worker.lock = threading.RLock() - # Create an object for interfacing with the global state. - ray.state.state._initialize_global_state( - node.redis_address, redis_password=node.redis_password) - driver_name = "" log_stdout_file_name = "" log_stderr_file_name = "" @@ -1268,6 +1264,12 @@ def connect(node, log_stderr_file_name, ) + # Create an object for interfacing with the global state. + # Note, global state should be intialized after `CoreWorker`, because it will + # use glog, which is intialized in `CoreWorker`. + ray.state.state._initialize_global_state( + node.redis_address, redis_password=node.redis_password) + if driver_object_store_memory is not None: worker.core_worker.set_object_store_client_options( "ray_driver_{}".format(os.getpid()), driver_object_store_memory)