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): ...@@ -106,16 +106,9 @@ class ConnectionPool(object):
# must drop some unused connections # must drop some unused connections
self._dropConnections() self._dropConnections()
self.connection_lock_release() conn = self._initNodeConnection(node)
try: if conn is not None:
conn = self._initNodeConnection(node) self.connection_dict[node.getUUID()] = conn
finally:
self.connection_lock_acquire()
if conn is None:
return None
self.connection_dict[node.getUUID()] = conn
return conn return conn
@profiler_decorator @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