Commit ce41a66d authored by Vincent Pelletier's avatar Vincent Pelletier

Prevent killing the ast connection iterated upon when no connection has been...

Prevent killing the ast connection iterated upon when no connection has been closed (kills primary master node connection when any storage is in a non-running state upon startup...).


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@803 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e408cc40
......@@ -272,6 +272,7 @@ class PrimaryNotificationsHandler(BaseHandler):
# close connection to this node if no longer running
if node_type in (MASTER_NODE_TYPE, STORAGE_NODE_TYPE) and \
state != RUNNING_STATE:
can_close = False
for conn in self.app.em.getConnectionList():
if conn.getUUID() == n.getUUID():
conn.lock()
......@@ -279,8 +280,9 @@ class PrimaryNotificationsHandler(BaseHandler):
conn.close()
finally:
conn.release()
can_close = True
break
if node_type == STORAGE_NODE_TYPE:
if can_close and node_type == STORAGE_NODE_TYPE:
# Remove from pool connection
app.cp.removeConnection(n)
......
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