Commit aa21ed33 authored by Aurel's avatar Aurel

do not failed in peerBroken method if node does not exist


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@257 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 95eaa500
...@@ -73,10 +73,11 @@ class ElectionEventHandler(MasterEventHandler): ...@@ -73,10 +73,11 @@ class ElectionEventHandler(MasterEventHandler):
addr = conn.getAddress() addr = conn.getAddress()
node = app.nm.getNodeByServer(addr) node = app.nm.getNodeByServer(addr)
if isinstance(conn, ClientConnection): if isinstance(conn, ClientConnection):
if node is not None:
node.setState(DOWN_STATE) node.setState(DOWN_STATE)
app.negotiating_master_node_set.discard(addr) app.negotiating_master_node_set.discard(addr)
else: else:
if node.getUUID() is not None: if node is not None and node.getUUID() is not None:
node.setState(BROKEN_STATE) node.setState(BROKEN_STATE)
MasterEventHandler.peerBroken(self, conn) MasterEventHandler.peerBroken(self, conn)
...@@ -237,7 +238,6 @@ class ElectionEventHandler(MasterEventHandler): ...@@ -237,7 +238,6 @@ class ElectionEventHandler(MasterEventHandler):
continue continue
info = n.getServer() + (n.getUUID() or INVALID_UUID,) info = n.getServer() + (n.getUUID() or INVALID_UUID,)
known_master_list.append(info) known_master_list.append(info)
p = Packet() p = Packet()
p.answerPrimaryMaster(packet.getId(), primary_uuid, known_master_list) p.answerPrimaryMaster(packet.getId(), primary_uuid, known_master_list)
conn.addPacket(p) conn.addPacket(p)
......
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