Adjust the state initialization sequence and put it after core worker google logging initialization (#8511)

This commit is contained in:
fangfengbin 2020-05-21 11:30:28 +08:00 committed by GitHub
parent ed2f434593
commit e261b4778e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)