Author: gsim
Date: Mon Aug 18 12:13:21 2008
New Revision: 686851

URL: http://svn.apache.org/viewvc?rev=686851&view=rev
Log:
QPID-1250: Ensure broker receives session.detached before channel can be 
reused. Merge of 686818 from trunk.

Modified:
    incubator/qpid/branches/qpid.0-10/python/qpid/delegates.py

Modified: incubator/qpid/branches/qpid.0-10/python/qpid/delegates.py
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/python/qpid/delegates.py?rev=686851&r1=686850&r2=686851&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/python/qpid/delegates.py (original)
+++ incubator/qpid/branches/qpid.0-10/python/qpid/delegates.py Mon Aug 18 
12:13:21 2008
@@ -74,8 +74,13 @@
     notify(ch.session.condition)
 
   def session_detach(self, ch, d):
-    ssn = self.connection.detach(d.name, ch)
+    #send back the confirmation of detachment before removing the
+    #channel from the attached set; this avoids needing to hold the
+    #connection lock during the sending of this control and ensures
+    #that if the channel is immediately reused for a new session the
+    #attach request will follow the detached notification.
     ch.session_detached(d.name)
+    ssn = self.connection.detach(d.name, ch)
 
   def session_detached(self, ch, d):
     self.connection.detach(d.name, ch)


Reply via email to