Commit f92d874c authored by Aurel's avatar Aurel

when client is notified of a storage node state, remove it from

connection pool and put fake packet into its notified all threads this
client can no longer be used


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@631 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 5680bb29
......@@ -112,6 +112,22 @@ class PrimaryHandler(BaseHandler):
for conn in self.app.em.getConnectionList():
if conn.getUUID() == n.getUUID():
conn.close()
break
if node_type == STORAGE_NODE_TYPE:
# Remove from pool connection
app.cp.removeConnection(n)
# Put fake packets to task queues.
queue_set = set()
for key in self.dispatcher.message_table.keys():
if id(conn) == key[0]:
queue = self.dispatcher.message_table.pop(key)
queue_set.add(queue)
# Storage failure is notified to the primary master when the fake
# packet if popped by a non-polling thread.
for queue in queue_set:
queue.put((conn, None))
class PrimaryBootstrapHandler(PrimaryHandler):
......
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