justheuristic 3 éve
szülő
commit
66655f7376
1 módosított fájl, 3 hozzáadás és 0 törlés
  1. 3 0
      hivemind/averaging/matchmaking.py

+ 3 - 0
hivemind/averaging/matchmaking.py

@@ -152,6 +152,9 @@ class Matchmaking:
         async with self.potential_leaders.begin_search(step, self.group_key_manager, declare=not self.client_mode):
             while True:
                 try:
+                    if step.cancelled():
+                        raise asyncio.CancelledError("Finishing abruptly because matchmaking was cancelled")
+
                     next_leader = await self.potential_leaders.pop_next_leader()  # throws TimeoutError on expiration
 
                     group = await self._request_join_group(next_leader)