Skip to content

Commit

Permalink
Don't log traceback for redis ConnectionError exception
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Sundaresan Rajangam committed May 13, 2016
1 parent 2a3f7fb commit 5e0db11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/opserver/partition_handler.py
Expand Up @@ -417,13 +417,16 @@ 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)
self._logger.error("[%s:%d] AlarmGen %s,%d %s : traceback %s" % \
(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()
Expand Down

0 comments on commit 5e0db11

Please sign in to comment.