Commit 33f73551 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Merge two loop over connection list in shutdown process.

Packets are sent are next poll(), there is no reason to register first
packets to clients nodes (at most one packet per connection here).

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1731 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 971e2764
......@@ -521,18 +521,13 @@ class Application(object):
continue
if self.cluster_state == ClusterStates.RUNNING:
sys.exit("Application has been asked to shut down")
# no more transaction, ask clients to shutdown
logging.info("asking all clients to shutdown")
logging.info("asking all nodes to shutdown")
for c in self.em.getConnectionList():
node = self.nm.getByUUID(c.getUUID())
if node.isClient():
node_list = [(node.getType(), node.getAddress(),
node.getUUID(), NodeStates.DOWN)]
c.notify(Packets.NotifyNodeInformation(node_list))
# then ask storages and master nodes to shutdown
logging.info("asking all remaining nodes to shutdown")
for c in self.em.getConnectionList():
node = self.nm.getByUUID(c.getUUID())
if node.isStorage() or node.isMaster():
node_list = [(node.getType(), node.getAddress(),
node.getUUID(), NodeStates.DOWN)]
......
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