You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by "Ganesh Murthy (JIRA)" <ji...@apache.org> on 2015/09/24 20:49:04 UTC
[jira] [Commented] (PROTON-1006) Sending pre-settled messages over
the python blocking api waits indefinetly
[ https://issues.apache.org/jira/browse/PROTON-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14906817#comment-14906817 ]
Ganesh Murthy commented on PROTON-1006:
---------------------------------------
Did a little bit analysis on what is going on -
The BlockingSender's send function (python/proton/utils.py) has a call to self.connection.wait as shown below -
{code:title=utils.py|borderStyle=solid}
class BlockingSender(BlockingLink):
def send(self, msg, timeout=False, error_states=None):
delivery = self.link.send(msg)
self.connection.wait(lambda: delivery.settled, msg="Sending on sender %s" % self.link.name, timeout=timeout)
bad = error_states
if bad is None:
bad = [Delivery.REJECTED, Delivery.RELEASED]
if delivery.remote_state in bad:
raise SendException(delivery.remote_state)
return delivery
{code}
The above code in turn calls the send function in the Message class -
{code:title=class Message|borderStyle=solid}
def send(self, sender, tag=None):
dlv = sender.delivery(tag or sender.delivery_tag())
encoded = self.encode()
sender.stream(encoded)
sender.advance()
if sender.snd_settle_mode == Link.SND_SETTLED:
dlv.settle()
return dlv
{code}
The dlv.settle() call goes through successfully but the lambda: delivery.settled always returns False and the BlockingSender's send waits indefinetly
> Sending pre-settled messages over the python blocking api waits indefinetly
> ---------------------------------------------------------------------------
>
> Key: PROTON-1006
> URL: https://issues.apache.org/jira/browse/PROTON-1006
> Project: Qpid Proton
> Issue Type: Bug
> Components: python-binding
> Affects Versions: 0.10
> Reporter: Ganesh Murthy
> Assignee: Gordon Sim
> Fix For: 0.10.1
>
> Attachments: helloworld_blocking_presettled.py
>
>
> Sending a pre-settled message (snd_settle_mode = Link.SND_SETTLED) over a blocking connection (using a blocking sender) blocks indefinetly.
> Steps to reproduce -
> 1. Modify the helloworld_blocking.py (located in examples/python folder) to add an AtMostOnce() call before creating the sender (or use the attached file helloworld_blocking_presettled.py)
> 2. Start broker.py (located in examples/python folder)
> 3. Run helloworld_blocking_presettled.py
> You will see that the send is blocking indefinetly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)