[ 
https://issues.apache.org/jira/browse/PROTON-2186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17079434#comment-17079434
 ] 

Jiri Daněk commented on PROTON-2186:
------------------------------------

Aha, got it. The above was for PROTON-2180.

Here it is 
https://github.com/rh-messaging/qdr-shipshape/blob/c74ec25c6f1a2055ee679da4117fe9f6144e4290/clients/python/basic.sender.py#L70-L84

{code:python}
    def on_released(self, event):
        # this is to prevent an issue we faced with two on_released
        # calls happening for same delivery tag
        # related proton frames below:
        #
        # [0x562a0083ed80]:0 <- @disposition(21) [role=true, first=981, 
state=@released(38) []]
        # [0x562a0083ed80]:0 <- @disposition(21) [role=true, first=981, 
last=982, settled=true, state=@released(38) []]
        #
        # in the sample above, the on_released was invoked 3 times for: 981, 
981 and 982.
        if event.delivery.tag in self._released_tags:
            return
        self._released_tags.append(event.delivery.tag)
        logging.debug("message released: %s" % event.delivery.tag)
        self.result_data.released += 1
        self.send(event, 'on_released')
{code}

> On released callback invoked twice for same delivery tag
> --------------------------------------------------------
>
>                 Key: PROTON-2186
>                 URL: https://issues.apache.org/jira/browse/PROTON-2186
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: python-binding
>            Reporter: Fernando Giorgetti
>            Priority: Major
>
> In a python client application, that is connected to a dispatch router, I 
> have observed that the on_released callback was invoked twice for the same 
> delivery tag.
> Here are the disposition frames I was able to capture for the respective 
> delivery:
> {noformat}
> [0x562a0083ed80]:0 <- @disposition(21) [role=true, first=981, 
> state=@released(38) []]
> [0x562a0083ed80]:0 <- @disposition(21) [role=true, first=981, last=982, 
> settled=true, state=@released(38) []]{noformat}
> The delivery tag 981 came first without the settlement and next with the 
> settled as true. And the on_released was called twice for the 981 delivery 
> tag.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to