Commit 1a330a1d authored by Vincent Pelletier's avatar Vincent Pelletier

Don't restart a complete connection to primary master when...

Don't restart a complete connection to primary master when requestNodeIdentification fails (for example if master is not ready).


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@747 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 5f6ca700
...@@ -406,15 +406,18 @@ class Application(object): ...@@ -406,15 +406,18 @@ class Application(object):
logging.info('connected to a primary master node') logging.info('connected to a primary master node')
# Identify to primary master and request initial data # Identify to primary master and request initial data
conn.lock() while conn.getUUID() is None:
try: conn.lock()
p = protocol.requestNodeIdentification(CLIENT_NODE_TYPE, try:
self.uuid, '0.0.0.0', 0, self.name) p = protocol.requestNodeIdentification(CLIENT_NODE_TYPE,
msg_id = conn.ask(p) self.uuid, '0.0.0.0', 0, self.name)
self.dispatcher.register(conn, msg_id, self.local_var.queue) msg_id = conn.ask(p)
finally: self.dispatcher.register(conn, msg_id, self.local_var.queue)
conn.unlock() finally:
self._waitMessage(conn, msg_id, handler=self.primary_bootstrap_handler) conn.unlock()
self._waitMessage(conn, msg_id, handler=self.primary_bootstrap_handler)
if conn.getUUID() is None:
time.sleep(5)
if self.uuid != INVALID_UUID: if self.uuid != INVALID_UUID:
# TODO: pipeline those 2 requests # TODO: pipeline those 2 requests
# This is currently impossible because _waitMessage can only # This is currently impossible because _waitMessage can only
......
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