Skip to content

Instantly share code, notes, and snippets.

@thobbs
Created November 16, 2010 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thobbs/702116 to your computer and use it in GitHub Desktop.
Save thobbs/702116 to your computer and use it in GitHub Desktop.
pycassa-25.diff
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