Skip to content

Commit d05a4cd

Browse files
committed
process_group: wait for futher_thread join before creating new one
1 parent 2f97660 commit d05a4cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

torchft/process_group.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,10 @@ def configure(self, store_addr: str, rank: int, world_size: int) -> None:
610610
self._rx.close()
611611
if self._future_queue is not None:
612612
self._future_queue.put(_QUEUE_CLOSE)
613-
assert self._future_queue is not None
613+
# wait for the future thread to exit and then close the queue
614+
if self._future_thread is not None:
615+
self._future_thread.join()
616+
if self._future_queue is not None:
614617
self._future_queue.close()
615618

616619
ctx = mp.get_context("spawn")

0 commit comments

Comments
 (0)