Commit 73281ff8 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix: Disallow multiple connections from client to storage

Keep lock around _initNodeConnection() in connection pool to avoid concurrent
connections to the same storage node.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2134 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 9b4ca06b
......@@ -106,16 +106,9 @@ class ConnectionPool(object):
# must drop some unused connections
self._dropConnections()
self.connection_lock_release()
try:
conn = self._initNodeConnection(node)
finally:
self.connection_lock_acquire()
if conn is None:
return None
self.connection_dict[node.getUUID()] = conn
conn = self._initNodeConnection(node)
if conn is not None:
self.connection_dict[node.getUUID()] = conn
return conn
@profiler_decorator
......
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