diff options
author | Bo Lopker <blopker@23andme.com> | 2015-11-27 08:42:14 -0800 |
---|---|---|
committer | Bo Lopker <blopker@23andme.com> | 2015-11-27 08:42:14 -0800 |
commit | 8e17aeb414a3acb0ffc44931d430d51303f3482f (patch) | |
tree | 790df40f54701d613c0914b0fadb225594e17f56 /redis/sentinel.py | |
parent | 16c8af4ef3750110ec1eeb09bd599db1959ea5ef (diff) | |
download | redis-py-8e17aeb414a3acb0ffc44931d430d51303f3482f.tar.gz |
FIX #651 try next Sentinel node on TimeoutError
Diffstat (limited to 'redis/sentinel.py')
-rw-r--r-- | redis/sentinel.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/redis/sentinel.py b/redis/sentinel.py index 3fb89ce..518fec5 100644 --- a/redis/sentinel.py +++ b/redis/sentinel.py @@ -4,7 +4,8 @@ import weakref from redis.client import StrictRedis from redis.connection import ConnectionPool, Connection -from redis.exceptions import ConnectionError, ResponseError, ReadOnlyError +from redis.exceptions import (ConnectionError, ResponseError, ReadOnlyError, + TimeoutError) from redis._compat import iteritems, nativestr, xrange @@ -211,7 +212,7 @@ class Sentinel(object): for sentinel_no, sentinel in enumerate(self.sentinels): try: masters = sentinel.sentinel_masters() - except ConnectionError: + except (ConnectionError, TimeoutError): continue state = masters.get(service_name) if state and self.check_master_state(state, service_name): @@ -235,7 +236,7 @@ class Sentinel(object): for sentinel in self.sentinels: try: slaves = sentinel.sentinel_slaves(service_name) - except (ConnectionError, ResponseError): + except (ConnectionError, ResponseError, TimeoutError): continue slaves = self.filter_slaves(slaves) if slaves: |