Commit bcc2d592 authored by Aurel's avatar Aurel

if state is the same as we already knwon, do not take the "node

information" message into account, in all other cases update our data


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@551 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 2825e342
......@@ -340,15 +340,11 @@ class ServiceEventHandler(MasterEventHandler):
# No change. Don't care.
continue
if state == RUNNING_STATE:
if state == node.getState():
# No problem.
# XXX means that if a node is known as broken and is notified as
# running, it will not be taken into account, is it OK ?
continue
# Something wrong happened possibly. Cut the connection to
# this node, if any, and notify the information to others.
# XXX this can be very slow.
node.setState(state)
if conn_node.getNodeType() == ADMIN_NODE_TYPE:
# reply to it
......@@ -356,13 +352,16 @@ class ServiceEventHandler(MasterEventHandler):
node_list = [(node.getNodeType(), ip, port, node.getUUID(), node.getState()),]
conn.answer(protocol.notifyNodeInformation(node_list), packet)
else:
# Something wrong happened possibly. Cut the connection to
# this node, if any, and notify the information to others.
# XXX this can be very slow.
# XXX does this need to be closed in all cases ?
for c in app.em.getConnectionList():
if c.getUUID() == uuid:
c.close()
logging.debug('broadcasting node information')
app.broadcastNodeInformation(node)
if node.getNodeType() == STORAGE_NODE_TYPE \
and state in (DOWN_STATE, BROKEN_STATE):
cell_list = app.pt.dropNode(node)
......
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