Skip to content

Commit a08ad91

Browse files
authored
Resolve potential deadlock in local_worker_manager (google#108)
- acquire lock -> future.set_result -> done_callback() -> ... -> _Stub. __getattr__ -> remote_call -> fetch lock -> deadlocked - Releasing the lock earlier resolves this.
1 parent 7b45c23 commit a08ad91

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler_opt/distributed/local/local_worker_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ def _msg_pump(self):
161161
with self._lock:
162162
future = self._map[task_result.msgid]
163163
del self._map[task_result.msgid]
164-
if task_result.success:
165-
future.set_result(task_result.value)
166-
else:
167-
future.set_exception(task_result.value)
164+
if task_result.success:
165+
future.set_result(task_result.value)
166+
else:
167+
future.set_exception(task_result.value)
168168

169169
# clear out pending futures and mark ourselves as "stopped" by null-ing
170170
# the map

0 commit comments

Comments
 (0)