summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2014-06-02 13:38:36 -0700
committerAndy McCurdy <andy@andymccurdy.com>2014-06-02 13:38:36 -0700
commit96f08d7c48a27a77da41c912fa52513d15a98681 (patch)
tree75c5d130668ba6ed796a7a396cc9a1ec66572620
parent2114574b1e52448cfdbc08f3f837e87efb753497 (diff)
downloadredis-py-96f08d7c48a27a77da41c912fa52513d15a98681.tar.gz
need to detect READONLY errors in read_response, now send_command. real fix
for #435
-rw-r--r--CHANGES4
-rw-r--r--redis/sentinel.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 54288c4..0f19282 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+* 2.10.1
+ * Fixed a bug where Sentinel connections to a server that's no longer a
+ master and receives a READONLY error will disconnect and reconnect to
+ the master.
* 2.10.0
* Discontinuted support for Python 2.5. Upgrade. You'll be happier.
* The HiRedis parser will now properly raise ConnectionErrors.
diff --git a/redis/sentinel.py b/redis/sentinel.py
index 0479690..2f30062 100644
--- a/redis/sentinel.py
+++ b/redis/sentinel.py
@@ -50,9 +50,9 @@ class SentinelManagedConnection(Connection):
continue
raise SlaveNotFoundError # Never be here
- def send_command(self, *args):
+ def read_response(self):
try:
- super(SentinelManagedConnection, self).send_command(*args)
+ return super(SentinelManagedConnection, self).read_response()
except ReadOnlyError:
if self.connection_pool.is_master:
# When talking to a master, a ReadOnlyError when likely