Commit 8fc436a8 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Bug fix: Avoid open two connections to the same node.

After the AnswerPrimary was received, the unconnected_master_node_set was filled with the primary address, causing a new connection at the next iteration in the _doElection method.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1540 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 761860a2
...@@ -198,14 +198,17 @@ class Application(object): ...@@ -198,14 +198,17 @@ class Application(object):
# Try to connect to master nodes. # Try to connect to master nodes.
for addr in list(self.unconnected_master_node_set): for addr in list(self.unconnected_master_node_set):
current_connections = [x.getAddress() for x in
self.em.getClientList()]
if addr not in current_connections:
ClientConnection(self.em, client_handler, addr=addr, ClientConnection(self.em, client_handler, addr=addr,
connector_handler=self.connector_handler) connector_handler=self.connector_handler)
self.em.poll(1) self.em.poll(1)
if len(self.unconnected_master_node_set | if len(self.unconnected_master_node_set |
self.negotiating_master_node_set) == 0: self.negotiating_master_node_set) == 0:
break break
def _announcePrimary(self): def _announcePrimary(self):
""" """
Broadcast the announce that I'm the primary Broadcast the announce that I'm the primary
......
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