Commit 80ef47b5 authored by Vincent Pelletier's avatar Vincent Pelletier

Apply SecondaryMasterHandler to all established connections after having set...

Apply SecondaryMasterHandler to all established connections after having set the identificationHandler on the listening connection.
This fixes primary master node not notifying secondary master node disconnections.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1168 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 40202050
...@@ -604,9 +604,23 @@ class Application(object): ...@@ -604,9 +604,23 @@ class Application(object):
# all incoming connections identify through this handler # all incoming connections identify through this handler
self.listening_conn.setHandler(identification.IdentificationHandler(self)) self.listening_conn.setHandler(identification.IdentificationHandler(self))
handler = secondary.SecondaryMasterHandler(self)
em = self.em
nm = self.nm
# Make sure that every connection has the secondary event handler.
for conn in em.getConnectionList():
conn_uuid = conn.getUUID()
if conn_uuid is not None:
node = nm.getNodeByUUID(conn_uuid)
assert node is not None
assert node.getType() == protocol.MASTER_NODE_TYPE
conn.setHandler(handler)
# If I know any storage node, make sure that they are not in the running state, # If I know any storage node, make sure that they are not in the running state,
# because they are not connected at this stage. # because they are not connected at this stage.
for node in self.nm.getStorageNodeList(): for node in nm.getStorageNodeList():
if node.getState() == RUNNING_STATE: if node.getState() == RUNNING_STATE:
node.setState(TEMPORARILY_DOWN_STATE) node.setState(TEMPORARILY_DOWN_STATE)
......
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