[checkmk-commits] Check_MK Git: check_mk: mkeventd: better error handling in case of broken pipe

git version control git at mathias-kettner.de
Sun Nov 18 11:24:59 CET 2012


Module: check_mk
Branch: master
Commit: 5fb3af76fa2d6156aa9d8638165bf53371998204
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5fb3af76fa2d6156aa9d8638165bf53371998204

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Sun Nov 18 11:12:59 2012 +0100

mkeventd: better error handling in case of broken pipe

---

 mkeventd/bin/mkeventd |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index 0ad51e8..f17a38e 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -481,6 +481,7 @@ def get_logfile_timespan(path):
     except:
         return 0.0, 0.0
 
+#.
 #   .--Perfcounters--------------------------------------------------------.
 #   |      ____            __                       _                      |
 #   |     |  _ \ ___ _ __ / _| ___ ___  _   _ _ __ | |_ ___ _ __ ___       |
@@ -1429,7 +1430,11 @@ class StatusServer:
             except Exception, e:
                 log("Error handling client %s: %s" % (addr_info, e))
                 if client_socket:
-                    client_socket.send("ERROR: %s\n" % e)
+                    try:
+                        client_socket.send("ERROR: %s\n" % e)
+                    except:
+                        pass # avoid next exception because of broken pipe!
+
                     client_socket.close()
                     client_socket = None
                 if opt_debug:



More information about the checkmk-commits mailing list