Commit f9df31be authored by Julien Muchembled's avatar 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).
parent a4731a0c
...@@ -28,6 +28,7 @@ class PrimaryBootstrapHandler(AnswerBaseHandler): ...@@ -28,6 +28,7 @@ class PrimaryBootstrapHandler(AnswerBaseHandler):
def notReady(self, conn, message): def notReady(self, conn, message):
self.app.trying_master_node = None self.app.trying_master_node = None
conn.close()
def _acceptIdentification(self, node, uuid, num_partitions, def _acceptIdentification(self, node, uuid, num_partitions,
num_replicas, your_uuid, primary, known_master_list): num_replicas, your_uuid, primary, known_master_list):
......
...@@ -45,6 +45,7 @@ class StorageBootstrapHandler(AnswerBaseHandler): ...@@ -45,6 +45,7 @@ class StorageBootstrapHandler(AnswerBaseHandler):
""" Handler used when connecting to a storage node """ """ Handler used when connecting to a storage node """
def notReady(self, conn, message): def notReady(self, conn, message):
conn.close()
raise NodeNotReady(message) raise NodeNotReady(message)
def _acceptIdentification(self, node, def _acceptIdentification(self, node,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment