File tree 4 files changed +16
-8
lines changed
4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -863,7 +863,8 @@ async def _reset(
863
863
if close :
864
864
if not _IS_SYNC :
865
865
await asyncio .gather (
866
- * [conn .close_conn (ConnectionClosedReason .POOL_CLOSED ) for conn in sockets ]
866
+ * [conn .close_conn (ConnectionClosedReason .POOL_CLOSED ) for conn in sockets ],
867
+ return_exceptions = True ,
867
868
)
868
869
else :
869
870
for conn in sockets :
@@ -899,7 +900,8 @@ async def _reset(
899
900
)
900
901
if not _IS_SYNC :
901
902
await asyncio .gather (
902
- * [conn .close_conn (ConnectionClosedReason .STALE ) for conn in sockets ]
903
+ * [conn .close_conn (ConnectionClosedReason .STALE ) for conn in sockets ],
904
+ return_exceptions = True ,
903
905
)
904
906
else :
905
907
for conn in sockets :
@@ -951,7 +953,8 @@ async def remove_stale_sockets(self, reference_generation: int) -> None:
951
953
close_conns .append (self .conns .pop ())
952
954
if not _IS_SYNC :
953
955
await asyncio .gather (
954
- * [conn .close_conn (ConnectionClosedReason .IDLE ) for conn in close_conns ]
956
+ * [conn .close_conn (ConnectionClosedReason .IDLE ) for conn in close_conns ],
957
+ return_exceptions = True ,
955
958
)
956
959
else :
957
960
for conn in close_conns :
Original file line number Diff line number Diff line change @@ -552,7 +552,7 @@ async def on_change(
552
552
if self ._opened and self ._description .has_server (server_description .address ):
553
553
await self ._process_change (server_description , reset_pool , interrupt_connections )
554
554
# Clear the pool from a failed heartbeat, done outside the lock to avoid blocking on connection close.
555
- if self . _opened and self . _description . has_server ( server_description . address ) and reset_pool :
555
+ if reset_pool :
556
556
server = self ._servers .get (server_description .address )
557
557
if server :
558
558
await server .pool .reset (interrupt_connections = interrupt_connections )
Original file line number Diff line number Diff line change @@ -861,7 +861,8 @@ def _reset(
861
861
if close :
862
862
if not _IS_SYNC :
863
863
asyncio .gather (
864
- * [conn .close_conn (ConnectionClosedReason .POOL_CLOSED ) for conn in sockets ]
864
+ * [conn .close_conn (ConnectionClosedReason .POOL_CLOSED ) for conn in sockets ],
865
+ return_exceptions = True ,
865
866
)
866
867
else :
867
868
for conn in sockets :
@@ -896,7 +897,10 @@ def _reset(
896
897
serviceId = service_id ,
897
898
)
898
899
if not _IS_SYNC :
899
- asyncio .gather (* [conn .close_conn (ConnectionClosedReason .STALE ) for conn in sockets ])
900
+ asyncio .gather (
901
+ * [conn .close_conn (ConnectionClosedReason .STALE ) for conn in sockets ],
902
+ return_exceptions = True ,
903
+ )
900
904
else :
901
905
for conn in sockets :
902
906
conn .close_conn (ConnectionClosedReason .STALE )
@@ -945,7 +949,8 @@ def remove_stale_sockets(self, reference_generation: int) -> None:
945
949
close_conns .append (self .conns .pop ())
946
950
if not _IS_SYNC :
947
951
asyncio .gather (
948
- * [conn .close_conn (ConnectionClosedReason .IDLE ) for conn in close_conns ]
952
+ * [conn .close_conn (ConnectionClosedReason .IDLE ) for conn in close_conns ],
953
+ return_exceptions = True ,
949
954
)
950
955
else :
951
956
for conn in close_conns :
Original file line number Diff line number Diff line change @@ -552,7 +552,7 @@ def on_change(
552
552
if self ._opened and self ._description .has_server (server_description .address ):
553
553
self ._process_change (server_description , reset_pool , interrupt_connections )
554
554
# Clear the pool from a failed heartbeat, done outside the lock to avoid blocking on connection close.
555
- if self . _opened and self . _description . has_server ( server_description . address ) and reset_pool :
555
+ if reset_pool :
556
556
server = self ._servers .get (server_description .address )
557
557
if server :
558
558
server .pool .reset (interrupt_connections = interrupt_connections )
You can’t perform that action at this time.
0 commit comments