Commit f9df31be by Julien Muchembled

client: do not wait for the remote to close the connection if it's not ready

This is currently not an issue because the 'time.sleep(1)' in iterateForObject
(storage) and _connectToPrimaryNode (master) leave enough time. What could
happen is a new connection attempt for a node that already has a connection
(causing a failure assertion in Node.setConnection).
1 parent a4731a0c
......@@ -28,6 +28,7 @@ class PrimaryBootstrapHandler(AnswerBaseHandler):
def notReady(self, conn, message):
self.app.trying_master_node = None
conn.close()
def _acceptIdentification(self, node, uuid, num_partitions,
num_replicas, your_uuid, primary, known_master_list):
......
......@@ -45,6 +45,7 @@ class StorageBootstrapHandler(AnswerBaseHandler):
""" Handler used when connecting to a storage node """
def notReady(self, conn, message):
conn.close()
raise NodeNotReady(message)
def _acceptIdentification(self, node,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!