You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2010/04/09 13:39:38 UTC
svn commit: r932362 - in /qpid/trunk/qpid/python/qpid:
messaging/endpoints.py tests/messaging/endpoints.py
Author: rhs
Date: Fri Apr 9 11:39:38 2010
New Revision: 932362
URL: http://svn.apache.org/viewvc?rev=932362&view=rev
Log:
cleanup waiter pipes on error
Modified:
qpid/trunk/qpid/python/qpid/messaging/endpoints.py
qpid/trunk/qpid/python/qpid/tests/messaging/endpoints.py
Modified: qpid/trunk/qpid/python/qpid/messaging/endpoints.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/messaging/endpoints.py?rev=932362&r1=932361&r2=932362&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/messaging/endpoints.py (original)
+++ qpid/trunk/qpid/python/qpid/messaging/endpoints.py Fri Apr 9 11:39:38 2010
@@ -174,6 +174,7 @@ class Connection:
def _check_error(self, exc=ConnectionError):
if self.error:
+ self._condition.gc()
raise exc(*self.error)
def _ewait(self, predicate, timeout=None, exc=ConnectionError):
Modified: qpid/trunk/qpid/python/qpid/tests/messaging/endpoints.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/tests/messaging/endpoints.py?rev=932362&r1=932361&r2=932362&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/tests/messaging/endpoints.py (original)
+++ qpid/trunk/qpid/python/qpid/tests/messaging/endpoints.py Fri Apr 9 11:39:38 2010
@@ -67,6 +67,26 @@ class SetupTests(Base):
while fds:
os.close(fds.pop())
+ def testOpenFailResourceLeaks(self):
+ fds = self.use_fds()
+ try:
+ for i in range(32):
+ if fds: os.close(fds.pop())
+ for i in xrange(64):
+ conn = Connection("localhost:0", **self.connection_options())
+ # XXX: we need to force a waiter to be created for this test
+ # to work
+ conn._lock.acquire()
+ conn._wait(lambda: False, timeout=0.001)
+ conn._lock.release()
+ try:
+ conn.open()
+ except ConnectError, e:
+ pass
+ finally:
+ while fds:
+ os.close(fds.pop())
+
def testReconnect(self):
options = self.connection_options()
import socket
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org