[Neo-report] r2172 vincent - /trunk/neo/client/pool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jun 17 17:51:03 CEST 2010


Author: vincent
Date: Thu Jun 17 17:51:02 2010
New Revision: 2172

Log:
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.

Modified:
    trunk/neo/client/pool.py

Modified: trunk/neo/client/pool.py
==============================================================================
--- trunk/neo/client/pool.py [iso-8859-1] (original)
+++ trunk/neo/client/pool.py [iso-8859-1] Thu Jun 17 17:51:02 2010
@@ -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)
 





More information about the Neo-report mailing list