From 4ec51a4660a28399461c56ed9f1f5b0bae5f2191 Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Tue, 6 Feb 2018 20:30:11 -0800 Subject: [PATCH] [rllib] Occasional Thread Error from RLlib (#1441) * fix * Revert "fix" This reverts commit 808f7d7688a837e5ce4cc4209ca28390bc29f1d8. * Driver's should ignore imports from other drivers. --- python/ray/worker.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/ray/worker.py b/python/ray/worker.py index b8795648c..6d1379afc 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -1635,6 +1635,13 @@ def fetch_and_execute_function_to_run(key, worker=global_worker): """Run on arbitrary function on the worker.""" driver_id, serialized_function = worker.redis_client.hmget( key, ["driver_id", "function"]) + + if (worker.mode in [SCRIPT_MODE, SILENT_MODE] and + driver_id != worker.task_driver_id.id()): + # This export was from a different driver and there's no need for this + # driver to import it. + return + try: # Deserialize the function. function = pickle.loads(serialized_function)