summaryrefslogtreecommitdiff
path: root/redis
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2014-04-10 16:20:03 -0700
committerAndy McCurdy <andy@andymccurdy.com>2014-04-10 16:20:03 -0700
commitf96e46b971a5bb66ab5f94ba87ab3e092e5f01ac (patch)
tree5f14946d117efb561859edccf43bdeedfc8eda14 /redis
parent8a49069d0259ac79e9122e4cf7c1579deac23905 (diff)
downloadredis-py-f96e46b971a5bb66ab5f94ba87ab3e092e5f01ac.tar.gz
mostly fixes #456. there's still an issue w/ hiredis and multi-bulk replies
Diffstat (limited to 'redis')
-rw-r--r--redis/client.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/redis/client.py b/redis/client.py
index 91807b1..136aade 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -2257,12 +2257,15 @@ class BasePipeline(object):
except ConnectionError:
conn.disconnect()
# if we're not already watching, we can safely retry the command
- # assuming it was a connection timeout
- if not self.watching:
- conn.send_command(*args)
- return self.parse_response(conn, command_name, **options)
- self.reset()
- raise
+ try:
+ if not self.watching:
+ conn.send_command(*args)
+ return self.parse_response(conn, command_name, **options)
+ except ConnectionError:
+ # the retry failed so cleanup.
+ conn.disconnect()
+ self.reset()
+ raise
def pipeline_execute_command(self, *args, **options):
"""