Commit 23848822 authored by Vincent Pelletier's avatar Vincent Pelletier

Remove unneeded connection state checks.

Since r2357 "ask" atomically checks connection state before sending, so early
check & locking are not needed here anymore.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2635 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 2c16ef6e
......@@ -65,22 +65,10 @@ class ConnectionPool(object):
node.getState())
conn = MTClientConnection(app.em, app.storage_event_handler, addr,
connector=app.connector_handler(), dispatcher=app.dispatcher)
conn.lock()
p = Packets.RequestIdentification(NodeTypes.CLIENT,
app.uuid, None, app.name)
try:
if conn.getConnector() is None:
# This happens, if a connection could not be established.
neo.lib.logging.error('Connection to %r failed', node)
self.notifyFailure(node)
return None
p = Packets.RequestIdentification(NodeTypes.CLIENT,
app.uuid, None, app.name)
msg_id = conn.ask(p, queue=app.local_var.queue)
finally:
conn.unlock()
try:
app._waitMessage(conn, msg_id,
handler=app.storage_bootstrap_handler)
except ConnectionClosed:
......
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