Commit 18226f49 authored by Vincent Pelletier's avatar Vincent Pelletier

Revert commit 252: connection is sent to dispatcher via registration, so it's safer to lock it.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@290 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent d04c53f2
......@@ -72,6 +72,8 @@ class ConnectionPool(object):
app.local_var.node_not_ready = 0
conn = MTClientConnection(app.em, handler, addr,
connector_handler=self.app.connector_handler)
conn.lock()
try:
if conn.getConnector() is None:
# This happens, if a connection could not be established.
logging.error('Connection to storage node %s failed', addr)
......@@ -85,6 +87,8 @@ class ConnectionPool(object):
conn.addPacket(p)
conn.expectMessage(msg_id)
app.dispatcher.register(conn, msg_id, app.getQueue())
finally:
conn.unlock()
try:
app._waitMessage(conn, msg_id)
......
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