Commit a6329aec authored by Grégory Wisniewski's avatar Grégory Wisniewski

Forget (remove) a node when it disconnect in pending state to ensure it will be

unknown when it comes back.
Add a logging entry for consistency.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@832 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent b8e777af
......@@ -816,7 +816,6 @@ class Application(object):
raise RuntimeError('unhandled cluster state')
return (uuid, state, handler)
def identifyNode(self, node_type, uuid, node):
state = protocol.RUNNING_STATE
......@@ -844,6 +843,7 @@ class Application(object):
elif node_type == protocol.STORAGE_NODE_TYPE:
klass = StorageNode
(uuid, state, handler) = self.identifyStorageNode(uuid, node)
logging.info('Accept a storage (%s)' % state)
return (uuid, node, state, handler, klass)
......@@ -31,9 +31,15 @@ class MasterEventHandler(EventHandler):
def _dropIt(self, conn, node, new_state):
if node is None or node.getState() == new_state:
return
# clean node related data in specialized handlers
self._nodeLost(conn, node)
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
# it and do not set in running state when it comes back
logging.info('drop a pending node from the node manager')
self.app.nm.remove(node)
node.setState(new_state)
self.app.broadcastNodeInformation(node)
self._nodeLost(conn, node)
def connectionClosed(self, conn):
node = self.app.nm.getNodeByUUID(conn.getUUID())
......
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