Commit 7990c1dc authored by Vincent Pelletier's avatar Vincent Pelletier

Do not silently ignore an unknown node in disconnection handler method. Any...

Do not silently ignore an unknown node in disconnection handler method. Any node being disconnedted at the level of this handler must be known, otherwise it's a bug.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1116 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 3c0e72ff
...@@ -78,7 +78,8 @@ class BaseServiceHandler(MasterHandler): ...@@ -78,7 +78,8 @@ class BaseServiceHandler(MasterHandler):
def handleConnectionLost(self, conn, new_state): def handleConnectionLost(self, conn, new_state):
node = self.app.nm.getNodeByUUID(conn.getUUID()) node = self.app.nm.getNodeByUUID(conn.getUUID())
if node is None or node.getState() == new_state: assert node is not None
if node.getState() == new_state:
return return
if new_state != protocol.BROKEN_STATE and node.getState() == protocol.PENDING_STATE: if new_state != protocol.BROKEN_STATE and node.getState() == protocol.PENDING_STATE:
# was in pending state, so drop it from the node manager to forget # was in pending state, so drop it from the node manager to forget
......
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