Skip to content

Commit

Permalink
partitionhandler should ensure that we always able to catch the geven…
Browse files Browse the repository at this point in the history
…t kill exception,

even when redis errors are encountered during reading aggregated UVEs.

Also, socket_timeout is needed to reduce outage when analytics node is rebooted

Change-Id: I17bd5cd971b57d78d8a1b74d8b3428b177459e1a
Closes-Bug: 1536085
  • Loading branch information
anishmehta committed Feb 11, 2016
1 parent 72003c1 commit 8cb5ef7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/opserver/partition_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _get_uve_content(self, table, barekeys, tfilter, ackfilter, keysonly):
host=pi.ip_address,
port=pi.port,
password=self._rpass,
db=7)
db=7, socket_timeout=90)
ppe = lredis.pipeline()
luves = list(uveparts[pkey])
for elem in luves:
Expand Down Expand Up @@ -335,13 +335,17 @@ def syncpart(self, redish):
def _run(self):
lredis = None
pb = None
pause = False
while True:
try:
if pause:
gevent.sleep(2)
pause = False
lredis = redis.StrictRedis(
host=self._pi.ip_address,
port=self._pi.port,
password=self._rpass,
db=7)
db=7, socket_timeout=90)
pb = lredis.pubsub()
inst = self._pi.instance_id
part = self._partno
Expand Down Expand Up @@ -422,7 +426,7 @@ def _run(self):
if pb is not None:
pb.close()
pb = None
gevent.sleep(2)
pause = True
return None

class UveStreamer(gevent.Greenlet):
Expand Down
2 changes: 1 addition & 1 deletion src/opserver/uveserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _redis_inst_get(self, r_inst):
if not self._redis_uve_map[r_inst]:
return redis.StrictRedis(
host=r_ip, port=r_port,
password=self._redis_password, db=1)
password=self._redis_password, db=1, socket_timeout=90)
else:
return self._redis_uve_map[r_inst]

Expand Down

0 comments on commit 8cb5ef7

Please sign in to comment.