From c43cb63e4696aaf53d35f3f564902e36d1a1ade5 Mon Sep 17 00:00:00 2001 From: "Jarisch, Ferdinand" Date: Tue, 3 Dec 2024 17:07:28 +0100 Subject: [PATCH] fix(doip): Do not fail ConnectionErrors while closing connection --- src/gallia/transports/doip.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallia/transports/doip.py b/src/gallia/transports/doip.py index 4b8452ac5..b71c55b46 100644 --- a/src/gallia/transports/doip.py +++ b/src/gallia/transports/doip.py @@ -732,7 +732,10 @@ async def close(self) -> None: self._read_task.cancel() self.writer.close() logger.debug("Awaiting confirmation of closed writer") - await self.writer.wait_closed() + try: + await self.writer.wait_closed() + except ConnectionError as e: + logger.debug(f"Exception while waiting for the writer to close: {e!r}") class DoIPConfig(BaseModel):