Skip to content

Commit

Permalink
fix(transport): Handle socket close error during reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
peckto authored and rumpelsepp committed Jul 14, 2023
1 parent 1555b89 commit f2c2596
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gallia/transports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ async def reconnect(self: TransportT, timeout: float | None = None) -> Transport
obsolete. This method is safe for concurrent use.
"""
async with self.mutex:
await self.close()
try:
await self.close()
except ConnectionError as e:
self.logger.debug(f"Socket close failed during reconnect ({e}); ignore")
return await self.connect(self.target)

@abstractmethod
Expand Down

0 comments on commit f2c2596

Please sign in to comment.