Skip to content

Commit

Permalink
Merge "partitionhandler should ensure that we always able to catch th…
Browse files Browse the repository at this point in the history
…e gevent kill exception, even when redis errors are encountered during reading aggregated UVEs."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 16, 2016
2 parents f0e90ea + 8cb5ef7 commit dc3ceda
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
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
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 dc3ceda

Please sign in to comment.