diff --git a/gunicorn/workers/base_async.py b/gunicorn/workers/base_async.py index 7b2daf91b..a19cd313f 100644 --- a/gunicorn/workers/base_async.py +++ b/gunicorn/workers/base_async.py @@ -73,11 +73,13 @@ def handle(self, listener, client, addr): self.log.debug("Error processing SSL request.") self.handle_error(req, client, addr, e) except EnvironmentError as e: - if e.errno not in (errno.EPIPE, errno.ECONNRESET): + if e.errno not in (errno.EPIPE, errno.ECONNRESET, errno.ENOTCONN): self.log.exception("Socket error processing request.") else: if e.errno == errno.ECONNRESET: self.log.debug("Ignoring connection reset") + elif e.errno == errno.ENOTCONN: + self.log.debug("Ignoring socket not connected") else: self.log.debug("Ignoring EPIPE") except Exception as e: diff --git a/gunicorn/workers/gthread.py b/gunicorn/workers/gthread.py index 376c3cb76..adfa7eac9 100644 --- a/gunicorn/workers/gthread.py +++ b/gunicorn/workers/gthread.py @@ -285,11 +285,13 @@ def handle(self, conn): self.handle_error(req, conn.sock, conn.client, e) except EnvironmentError as e: - if e.errno not in (errno.EPIPE, errno.ECONNRESET): + if e.errno not in (errno.EPIPE, errno.ECONNRESET, errno.ENOTCONN): self.log.exception("Socket error processing request.") else: if e.errno == errno.ECONNRESET: self.log.debug("Ignoring connection reset") + elif e.errno == errno.ENOTCONN: + self.log.debug("Ignoring socket not connected") else: self.log.debug("Ignoring connection epipe") except Exception as e: diff --git a/gunicorn/workers/sync.py b/gunicorn/workers/sync.py index fd423bc9e..700a1b85d 100644 --- a/gunicorn/workers/sync.py +++ b/gunicorn/workers/sync.py @@ -146,11 +146,13 @@ def handle(self, listener, client, addr): self.log.debug("Error processing SSL request.") self.handle_error(req, client, addr, e) except EnvironmentError as e: - if e.errno not in (errno.EPIPE, errno.ECONNRESET): + if e.errno not in (errno.EPIPE, errno.ECONNRESET, errno.ENOTCONN): self.log.exception("Socket error processing request.") else: if e.errno == errno.ECONNRESET: self.log.debug("Ignoring connection reset") + elif e.errno == errno.ENOTCONN: + self.log.debug("Ignoring socket not connected") else: self.log.debug("Ignoring EPIPE") except Exception as e: