diff --git a/CHANGES b/CHANGES index e2f634e963..cce79b1055 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +* 2.4.9 (in development) + * Removed socket retry logic in Connection. This is the responsbility of + the caller to determine if the command is safe and can be retried. Thanks + David Wolver. * 2.4.8 * Imported with_statement from __future__ for Python 2.5 compatability. * 2.4.7 diff --git a/redis/connection.py b/redis/connection.py index ff7f277633..a85129b3e4 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -174,8 +174,8 @@ def disconnect(self): pass self._sock = None - def _send(self, command): - "Send the command to the socket" + def send_packed_command(self, command): + "Send an already packed command to the Redis server" if not self._sock: self.connect() try: @@ -190,17 +190,6 @@ def _send(self, command): raise ConnectionError("Error %s while writing to socket. %s." % \ (_errno, errmsg)) - def send_packed_command(self, command): - "Send an already packed command to the Redis server" - try: - self._send(command) - except ConnectionError: - # retry the command once in case the socket connection simply - # timed out - self.disconnect() - # if this _send() call fails, then the error will be raised - self._send(command) - def send_command(self, *args): "Pack and send a command to the Redis server" self.send_packed_command(self.pack_command(*args))