Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Handle disconnection #77

Merged
merged 1 commit into from Jul 31, 2012
Jump to file or symbol
Failed to load files and symbols.
+4 −0
Split
@@ -239,6 +239,9 @@ def _send_request(self, connection, req_bytes):
## read a response from the connection
def _receive_response(self, connection):
size_bytes = connection.recv(4)
+ if not size_bytes:
+ raise VoldemortException('Connection closed')
+
size = struct.unpack('>i', size_bytes)[0]
bytes_read = 0
@@ -252,6 +255,7 @@ def _receive_response(self, connection):
return ''.join(data)
+
## Bootstrap cluster metadata from a list of urls of nodes in the cluster.
## The urls are tuples in the form (host, port).
## A dictionary of node_id => node is returned.