Commit 8ba76a4f authored by Vincent Pelletier's avatar Vincent Pelletier

Close storage connection right after sending it a shutdown request.

Otherwise, storage shutdown would be handled as an unexpected
disconnection, and would cause the node to reappear as temporarily down.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1602 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ee265260
......@@ -77,20 +77,27 @@ class AdministrationHandler(MasterHandler):
else:
# no connection to the node
raise protocol.ProtocolError('no connection to the node')
node.setState(state)
elif state == NodeStates.DOWN and node.isStorage():
node.setState(state)
for storage_conn in app.em.getConnectionListByUUID(uuid):
storage_conn.close()
# modify the partition table if required
cell_list = []
if modify_partition_table:
# remove from pt
cell_list = app.pt.dropNode(node)
app.nm.remove(node)
else:
# outdate node in partition table
cell_list = app.pt.outdate()
app.broadcastPartitionChanges(cell_list)
# /!\ send the node information *after* the partition table change
else:
node.setState(state)
# /!\ send the node information *after* the partition table change
p = protocol.ack('state changed')
conn.answer(p)
app.broadcastNodesInformation([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