Commit a29756a3 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix deadlock when connecting to an unreachable storage node.

Deadlock occurs between connection establishment (which holds the pool
lock and waits for an answer on its thread queue) and epoll thread, which
tries to unregister the connection from pool (trying to take pool lock)
before notifying the queue.
Unregistering a connection from pool does not require taking the pool lock,
as it is just meant to prevent connections from being created in parallel.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2172 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 9b0baf8a
......@@ -137,12 +137,5 @@ class ConnectionPool(object):
@profiler_decorator
def removeConnection(self, node):
"""Explicitly remove connection when a node is broken."""
self.connection_lock_acquire()
try:
try:
del self.connection_dict[node.getUUID()]
except KeyError:
pass
finally:
self.connection_lock_release()
self.connection_dict.pop(node.getUUID(), None)
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