Commit 462ebca0 authored by Vincent Pelletier's avatar Vincent Pelletier

Test for partition table readiness at the end of the loop before sleeping...

Test for partition table readiness at the end of the loop before sleeping rather than at the begining.
 - prevents from sleeping before exiting the loop in the even of a successful connection attemp
 - partition table got flushed a few lines above, so this test is always true on the first loop iteration.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@315 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent cb08ffaf
...@@ -81,9 +81,6 @@ class Dispatcher(Thread): ...@@ -81,9 +81,6 @@ class Dispatcher(Thread):
app._waitMessage() app._waitMessage()
handler = ClientEventHandler(app, app.dispatcher) handler = ClientEventHandler(app, app.dispatcher)
while 1: while 1:
if app.pt is not None and app.pt.operational():
# Connected to primary master node and got all informations
break
app.local_var.node_not_ready = 0 app.local_var.node_not_ready = 0
if app.primary_master_node is None: if app.primary_master_node is None:
# Try with master node defined in config # Try with master node defined in config
...@@ -138,6 +135,9 @@ class Dispatcher(Thread): ...@@ -138,6 +135,9 @@ class Dispatcher(Thread):
elif app.pt is not None and app.pt.operational(): elif app.pt is not None and app.pt.operational():
# Connected to primary master node # Connected to primary master node
break break
if app.pt is not None and app.pt.operational():
# Connected to primary master node and got all informations
break
time.sleep(1) time.sleep(1)
logging.info("connected to primary master node %s:%d" %app.primary_master_node.getServer()) logging.info("connected to primary master node %s:%d" %app.primary_master_node.getServer())
......
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