Created
November 16, 2010 17:22
-
-
Save thobbs/702116 to your computer and use it in GitHub Desktop.
pycassa-25.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index 7abca4f..c451f90 100644 | |
--- a/pycassa/connection.py | |
+++ b/pycassa/connection.py | |
@@ -47,6 +47,7 @@ class ClientTransport(object): | |
"""Encapsulation of a client session.""" | |
def __init__(self, keyspace, server, framed_transport, timeout, credentials, recycle): | |
+ self.server = server | |
host, port = server.split(":") | |
socket = TSocket.TSocket(host, int(port)) | |
if timeout is not None: | |
@@ -232,6 +233,7 @@ class Connection(object): | |
except (UnavailableException, TimedOutException), exc: | |
log.exception(exc) | |
self.close() | |
+ self._servers.mark_dead(conn.server) | |
return _client_call(*args, **kwargs) # Retry | |
except (Thrift.TException, socket.timeout, socket.error), exc: | |
log.exception('Client error: %s', exc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment