From 0b397ccee256d865e087bfbc379f0cbe530eaedc Mon Sep 17 00:00:00 2001 From: Taha Jahangir Date: Sun, 12 May 2013 22:46:13 +0430 Subject: [PATCH] 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 --- tornado/iostream.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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: -- 2.47.2