Commit 5ae7dc58 authored by Vincent Pelletier's avatar Vincent Pelletier

Use attribute tracking ability to help locate assertion failures.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1564 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent f6140d82
...@@ -86,7 +86,8 @@ class ClientElectionHandler(ElectionHandler): ...@@ -86,7 +86,8 @@ class ClientElectionHandler(ElectionHandler):
def connectionFailed(self, conn): def connectionFailed(self, conn):
addr = conn.getAddress() addr = conn.getAddress()
node = self.app.nm.getByAddress(addr) node = self.app.nm.getByAddress(addr)
assert node.isUnknown(), node.getState() assert node.isUnknown(), (self.app.uuid, node.whoSetState(),
node.getState())
# connection never success, node is still in unknown state # connection never success, node is still in unknown state
self.app.negotiating_master_node_set.discard(addr) self.app.negotiating_master_node_set.discard(addr)
self.app.unconnected_master_node_set.add(addr) self.app.unconnected_master_node_set.add(addr)
...@@ -103,7 +104,8 @@ class ClientElectionHandler(ElectionHandler): ...@@ -103,7 +104,8 @@ class ClientElectionHandler(ElectionHandler):
def _connectionLost(self, conn): def _connectionLost(self, conn):
addr = conn.getAddress() addr = conn.getAddress()
node = self.app.nm.getByAddress(addr) node = self.app.nm.getByAddress(addr)
assert not node.isUnknown(), node.getState() assert not node.isUnknown(), (self.app.uuid, node.whoSetState(),
node.getState())
node.setTemporarilyDown() node.setTemporarilyDown()
self.app.negotiating_master_node_set.discard(addr) self.app.negotiating_master_node_set.discard(addr)
MasterHandler.connectionClosed(self, conn) MasterHandler.connectionClosed(self, conn)
......
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