From 581f4505be18bca44ec771d87b8ad28fba98ee63 Mon Sep 17 00:00:00 2001 From: Joongi Kim Date: Thu, 29 Feb 2024 01:50:25 +0900 Subject: [PATCH] fix: Clean up debug logs --- src/callosum/lower/zeromq.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/callosum/lower/zeromq.py b/src/callosum/lower/zeromq.py index 1f9a511..209c521 100644 --- a/src/callosum/lower/zeromq.py +++ b/src/callosum/lower/zeromq.py @@ -242,7 +242,15 @@ async def recv_message(self) -> AsyncGenerator[Optional[RawHeaderBody], None]: else: # client yield RawHeaderBody(raw_header, raw_body, None) + else: + # Ignore if the peer has sent a malformed multipart message. + log.debug( + "ZeroMQRPCConnection.recv_message(): " + "ignoring an invalid message from the peer..." + ) except Exception as e: + # ValueError may happen when there are garbage packets accepted by + # the zmq socket. log.debug( "ZeroMQRPCConnection.recv_message(): " "exception caught in the recv loop, continuing...",