justheuristic 3 năm trước cách đây
mục cha
commit
c3275f0cd1
1 tập tin đã thay đổi với 7 bổ sung3 xóa
  1. 7 3
      hivemind/averaging/averager.py

+ 7 - 3
hivemind/averaging/averager.py

@@ -423,9 +423,13 @@ class DecentralizedAverager(mp.Process, ServicerBase):
                         await step.wait_for_trigger()
                     return group_info
                 except asyncio.CancelledError:
-                    for peer_id in group_info.peer_ids:
-                        if peer_id != self.peer_id:
-                            asyncio.ensure_future(self._send_error_to_peer(peer_id, group_info.group_id, averaging_pb2.CANCELLED))
+                    await asyncio.wait(
+                        {
+                            self._send_error_to_peer(peer_id, group_info.group_id, averaging_pb2.CANCELLED)
+                            for peer_id in group_info.peer_ids
+                            if peer_id != self.peer_id
+                        }
+                    )
                     raise
 
             while not step.done():