qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r518707 - /incubator/qpid/branches/qpid.0-9/python/qpid/peer.py
Date Thu, 15 Mar 2007 17:49:45 GMT
Author: aconway
Date: Thu Mar 15 10:49:44 2007
New Revision: 518707

URL: http://svn.apache.org/viewvc?view=rev&rev=518707
Log:

* python/qpid/peer.py (Peer.close): Close delegate *before* channels.
  Otherwise we get a race: closing a channel can wake a client thread,
  which may see client.closed as still false. Was causing bogus exceptions
  in some tests.

Modified:
    incubator/qpid/branches/qpid.0-9/python/qpid/peer.py

Modified: incubator/qpid/branches/qpid.0-9/python/qpid/peer.py
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/python/qpid/peer.py?view=diff&rev=518707&r1=518706&r2=518707
==============================================================================
--- incubator/qpid/branches/qpid.0-9/python/qpid/peer.py (original)
+++ incubator/qpid/branches/qpid.0-9/python/qpid/peer.py Thu Mar 15 10:49:44 2007
@@ -97,9 +97,12 @@
       self.fatal()
 
   def close(self, reason):
+    # We must close the delegate first because closing channels
+    # may wake up waiting threads and we don't want them to see
+    # the delegate as open.
+    self.delegate.close(reason)
     for ch in self.channels.values():
       ch.close(reason)
-    self.delegate.close(reason)
 
   def writer(self):
     try:



Mime
View raw message