]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Don't log EPIPE (broken pipe) errors as warnings 784/head
authorTaha Jahangir <mtjahangir@gmail.com>
Sun, 12 May 2013 18:16:13 +0000 (22:46 +0430)
committerTaha Jahangir <mtjahangir@gmail.com>
Sun, 12 May 2013 18:16:13 +0000 (22:46 +0430)
Broken pipe errors are usually caused by connection reset, and its better to not log EPIPE errors to minimize log spam

tornado/iostream.py

index 1dfe06a686d0d7d68d871875bbe38805930be6cd..8545fcf4af556cddf053d77d1549f52be008472a 100644 (file)
@@ -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: