Fix core worker shutdown errors (#6004)

This commit is contained in:
Edward Oakes 2019-10-24 22:29:05 -07:00 committed by GitHub
parent 71a2f4c63d
commit 6f27d881bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1669,12 +1669,11 @@ def disconnect(exiting_interpreter=False):
worker.function_actor_manager.reset_cache()
worker.serialization_context_map.clear()
if not exiting_interpreter:
if hasattr(worker, "raylet_client"):
del worker.raylet_client
if hasattr(worker, "core_worker"):
del worker.core_worker
# We need to destruct the core worker here because after this function,
# we will tear down any processes spawned by ray.init() and the background
# threads in the core worker don't currently handle that gracefully.
if hasattr(worker, "core_worker"):
del worker.core_worker
@contextmanager