Skip to content

Commit dc7acee

Browse files
committed
Speed up cluster shutdown
This permits servers to allow "terminate" comms to persist when shutting down. Closes #6413
1 parent 9bb999d commit dc7acee

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

distributed/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,11 @@ def close(self):
680680
for i in range(20):
681681
# If there are still handlers running at this point, give them a
682682
# second to finish gracefully themselves, otherwise...
683-
if any(self._comms.values()):
683+
if any(comm for comm in self._comms.values() if comm != "terminate"):
684684
yield asyncio.sleep(0.05)
685685
else:
686686
break
687+
687688
yield self.rpc.close()
688689
yield [comm.close() for comm in list(self._comms)] # then forcefully close
689690
for cb in self._ongoing_coroutines:

0 commit comments

Comments
 (0)