From 38d2bc4c9cb4b89c411d6eeac823a2950001f287 Mon Sep 17 00:00:00 2001 From: Anish Mehta Date: Fri, 20 Jan 2017 12:36:00 -0800 Subject: [PATCH] alarmgen should exit if we see a too-many-files error. Closes-Bug:1656444 Change-Id: If573bf3ed4bda8b2a81938b945136b035f5ce47d --- src/opserver/partition_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/opserver/partition_handler.py b/src/opserver/partition_handler.py index 0a95887a8de..13f19cd4de7 100644 --- a/src/opserver/partition_handler.py +++ b/src/opserver/partition_handler.py @@ -18,6 +18,7 @@ from pysandesh.util import UTCTimestampUsec import select import redis +import errno from collections import namedtuple PartInfo = namedtuple("PartInfo",["ip_address","instance_id","acq_time","port"]) @@ -637,6 +638,10 @@ def _run(self): self.stop_partition() self._failed = True pause = True + if hasattr(ex,'errno'): + # This is an unrecoverable error + if ex.errno == errno.EMFILE: + raise SystemExit(1) self._logger.error("Stopping %s pcount %d" % (self._topic, pcount)) partdb = self.stop_partition()