Consodiate CI Python tests and fix bug about multiple ray.init (#4195)

This commit is contained in:
Hao Chen
2019-03-02 06:38:28 +08:00
committed by Robert Nishihara
parent 9c48cc27aa
commit 6f1a29ad3f
4 changed files with 23 additions and 52 deletions
+4
View File
@@ -161,6 +161,9 @@ class Worker(object):
# This event is checked regularly by all of the threads so that they
# know when to exit.
self.threads_stopped = threading.Event()
# Index of the current session. This number will
# increment every time when `ray.shutdown` is called.
self._session_index = 0
@property
def task_context(self):
@@ -2064,6 +2067,7 @@ def disconnect():
if hasattr(worker, "logger_thread"):
worker.logger_thread.join()
worker.threads_stopped.clear()
worker._session_index += 1
worker.connected = False
worker.cached_functions_to_run = []