mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 10:49:16 +08:00
Add lock in fetch_and_execute_function_to_run of import_thread.py (#4718)
This commit is contained in:
committed by
Robert Nishihara
parent
4eade036a0
commit
448a7bd08d
@@ -124,8 +124,11 @@ class ImportThread(object):
|
||||
return
|
||||
|
||||
try:
|
||||
# Deserialize the function.
|
||||
function = pickle.loads(serialized_function)
|
||||
# FunctionActorManager may call pickle.loads at the same time.
|
||||
# Importing the same module in different threads causes deadlock.
|
||||
with self.worker.function_actor_manager.lock:
|
||||
# Deserialize the function.
|
||||
function = pickle.loads(serialized_function)
|
||||
# Run the function.
|
||||
function({"worker": self.worker})
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user