Commit e41dbfef authored by Julien Muchembled's avatar Julien Muchembled

election: fix a case where the primary has wrong state information about another master

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2722 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4836a4b4
...@@ -172,13 +172,10 @@ class ServerElectionHandler(MasterHandler): ...@@ -172,13 +172,10 @@ class ServerElectionHandler(MasterHandler):
def reelectPrimary(self, conn): def reelectPrimary(self, conn):
raise ElectionFailure, 'reelection requested' raise ElectionFailure, 'reelection requested'
def peerBroken(self, conn): def connectionLost(self, conn, new_state):
app = self.app node = self.app.nm.getByUUID(conn.getUUID())
addr = conn.getAddress() if node is not None:
node = app.nm.getByAddress(addr) node.setState(new_state)
if node is not None and node.getUUID() is not None:
node.setBroken()
MasterHandler.peerBroken(self, conn)
def requestIdentification(self, conn, node_type, def requestIdentification(self, conn, node_type,
uuid, address, name): uuid, address, name):
......
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