From 5e0db117316e1cbd5d1a2df4c418d952259bd089 Mon Sep 17 00:00:00 2001 From: Sundaresan Rajangam Date: Wed, 11 May 2016 14:50:58 -0700 Subject: [PATCH] Don't log traceback for redis ConnectionError exception In partition_handler, the redis connection timesout if there is no activity for 90 seconds. We have catch all exception that logs the traceback. Need to catch the ConnectionError exception and not log the traceback for this case. Change-Id: If2f391d5ddf3a04aed82b889b1d780de60c4da6b Closes-Bug: #1578779 --- src/opserver/partition_handler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/opserver/partition_handler.py b/src/opserver/partition_handler.py index e9f462337af..5a6a7607621 100644 --- a/src/opserver/partition_handler.py +++ b/src/opserver/partition_handler.py @@ -417,6 +417,8 @@ def _run(self): except gevent.GreenletExit: break + except redis.exceptions.ConnectionError: + pass except Exception as ex: template = "Exception {0} in uve stream proc. Arguments:\n{1!r}" messag = template.format(type(ex).__name__, ex.args) @@ -424,6 +426,7 @@ def _run(self): (self._pi.ip_address, self._pi.port, \ self._pi.instance_id, self._partno, \ messag, traceback.format_exc())) + finally: lredis = None if pb is not None: pb.close()