From 54baf62bea52113d6ed8b0965db19ba8e25e0c46 Mon Sep 17 00:00:00 2001 From: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com> Date: Wed, 24 Nov 2021 20:56:14 +0530 Subject: [PATCH] Convert `recv` errors as warnings and not exceptions (#787) --- proxy/http/handler.py | 6 +++--- proxy/http/proxy/server.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/proxy/http/handler.py b/proxy/http/handler.py index a29e852e7b..91c96624ca 100644 --- a/proxy/http/handler.py +++ b/proxy/http/handler.py @@ -286,9 +286,9 @@ async def handle_readables(self, readables: Readables) -> bool: # here to avoid flooding the logs. logger.debug('%r' % e) else: - logger.exception( - 'Exception while receiving from %s connection %r with reason %r' % - (self.work.tag, self.work.connection, e), + logger.warning( + 'Exception when receiving from %s connection#%d with reason %r' % + (self.work.tag, self.work.connection.fileno(), e), ) return True return False diff --git a/proxy/http/proxy/server.py b/proxy/http/proxy/server.py index b8181d663e..c9f01d1639 100644 --- a/proxy/http/proxy/server.py +++ b/proxy/http/proxy/server.py @@ -291,9 +291,9 @@ async def read_from_descriptors(self, r: Readables) -> bool: ), ) else: - logger.exception( - 'Exception while receiving from %s connection %r with reason %r' % - (self.upstream.tag, self.upstream.connection, e), + logger.warning( + 'Exception while receiving from %s connection#%d with reason %r' % + (self.upstream.tag, self.upstream.connection.fileno(), e), ) return self._close_and_release()