Skip to content

Commit

Permalink
alarmgen should exit if we see a too-many-files error.
Browse files Browse the repository at this point in the history
Closes-Bug:1656444

Change-Id: If573bf3ed4bda8b2a81938b945136b035f5ce47d
  • Loading branch information
anishmehta committed Jan 20, 2017
1 parent 3e95c11 commit 38d2bc4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/opserver/partition_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 38d2bc4

Please sign in to comment.