From: Taha Jahangir Date: Sun, 12 May 2013 18:16:13 +0000 (+0430) Subject: Don't log EPIPE (broken pipe) errors as warnings X-Git-Tag: v3.1.0~76^2~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F784%2Fhead;p=thirdparty%2Ftornado.git Don't log EPIPE (broken pipe) errors as warnings Broken pipe errors are usually caused by connection reset, and its better to not log EPIPE errors to minimize log spam --- diff --git a/tornado/iostream.py b/tornado/iostream.py index 1dfe06a68..8545fcf4a 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -547,8 +547,12 @@ class BaseIOStream(object): self._write_buffer_frozen = True break else: - gen_log.warning("Write error on %d: %s", - self.fileno(), e) + if e.args[0] != errno.EPIPE: + # Broken pipe errors are usually caused by connection + # reset, and its better to not log EPIPE errors to + # minimize log spam + gen_log.warning("Write error on %d: %s", + self.fileno(), e) self.close(exc_info=True) return if not self._write_buffer and self._write_callback: