You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/03/15 18:49:45 UTC

svn commit: r518707 - /incubator/qpid/branches/qpid.0-9/python/qpid/peer.py

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: