Author: kwall
Date: Tue Jun  9 08:29:52 2015
New Revision: 1684350

URL: http://svn.apache.org/r1684350
Log:
QPID-6567: [Python Client] Centralise responsibilities for 
flow_control_wait_condition lock used on the 08..091 path

Modified:
    qpid/trunk/qpid/python/qpid/peer.py

Modified: qpid/trunk/qpid/python/qpid/peer.py
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/peer.py?rev=1684350&r1=1684349&r2=1684350&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/peer.py (original)
+++ qpid/trunk/qpid/python/qpid/peer.py Tue Jun  9 08:29:52 2015
@@ -348,9 +348,11 @@ class Channel:
 
     if frame.method.klass.name == "basic" and frame.method.name == "publish":
       self._flow_control_wait_condition.acquire()
-      self.check_flow_control()
-      self.write(frame, content)
-      self._flow_control_wait_condition.release()
+      try:
+        self.check_flow_control()
+        self.write(frame, content)
+      finally:
+        self._flow_control_wait_condition.release()
     else:
       self.write(frame, content)
 
@@ -407,7 +409,6 @@ class Channel:
     if self._flow_control:
       self._flow_control_wait_condition.wait(self._flow_control_wait_failure)
     if self._flow_control:
-      self._flow_control_wait_condition.release()
       raise Timeout("Unable to send message for " + 
str(self._flow_control_wait_failure) + " seconds due to broker enforced flow 
control")
 
   def __getattr__(self, name):



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to