summaryrefslogtreecommitdiff
path: root/python/qpid/management.py
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-04-18 14:49:15 +0000
committerAlan Conway <aconway@apache.org>2008-04-18 14:49:15 +0000
commiteed3c6cc9b9b4fa75e7b95b6ba3efcb23d3bd962 (patch)
tree4ca59a228cde813aae759225df92cc115f750de4 /python/qpid/management.py
parentff4a39a88a6bb1ebfdb407c9535862d828954093 (diff)
downloadqpid-python-eed3c6cc9b9b4fa75e7b95b6ba3efcb23d3bd962.tar.gz
From Ted Ross: https://issues.apache.org/jira/browse/QPID-934
This patch fixes a problem related to multiple management sessions run over the same AMQP session (typically seen in test environments). git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@649554 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/management.py')
-rw-r--r--python/qpid/management.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/python/qpid/management.py b/python/qpid/management.py
index d32d458270..6b25d5ea08 100644
--- a/python/qpid/management.py
+++ b/python/qpid/management.py
@@ -176,6 +176,7 @@ class managementClient:
mch = managementChannel (channel, self.topicCb, self.replyCb, cbContext)
self.channels.append (mch)
+ self.incOutstanding (mch)
codec = Codec (StringIO (), self.spec)
self.setHeader (codec, ord ('B'))
msg = Content (codec.stream.getvalue ())
@@ -213,6 +214,10 @@ class managementClient:
def syncWaitForStable (self, channel):
""" Synchronous (blocking) call to wait for schema stability on a channel """
self.cv.acquire ()
+ if channel.reqsOutstanding == 0:
+ self.cv.release ()
+ return
+
self.syncInFlight = True
starttime = time ()
while channel.reqsOutstanding != 0:
@@ -470,7 +475,6 @@ class managementClient:
sendCodec = Codec (StringIO (), self.spec)
seq = self.seqMgr.reserve ("outstanding")
self.setHeader (sendCodec, ord ('P'), seq)
- self.incOutstanding (ch)
smsg = Content (sendCodec.stream.getvalue ())
smsg["content_type"] = "application/octet-stream"
smsg["routing_key"] = "agent"
@@ -508,7 +512,8 @@ class managementClient:
if (cname, hash) not in self.packages[pname]:
# Send a schema request
sendCodec = Codec (StringIO (), self.spec)
- self.setHeader (sendCodec, ord ('S'))
+ seq = self.seqMgr.reserve ("outstanding")
+ self.setHeader (sendCodec, ord ('S'), seq)
self.incOutstanding (ch)
sendCodec.encode_shortstr (pname)
sendCodec.encode_shortstr (cname)