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

ASF GitHub Bot commented on PROTON-2029:
----------------------------------------

gemmellr commented on issue #33: PROTON-2029 Add fix and test for extraneous 
disposition after settle
URL: https://github.com/apache/qpid-proton-j/pull/33#issuecomment-488271342
 
 
   When I originally raised the JIRA I looked at a change while identifying the 
bug, and did something slightly different:
   ```
   +++ 
b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/DeliveryImpl.java
   @@ -133,7 +133,7 @@ public class DeliveryImpl implements Delivery
        public void disposition(final DeliveryState state)
        {
            _deliveryState = state;
   -        if(!_remoteSettled)
   +        if(!_remoteSettled && !_settled)
            {
                addToTransportWorkList();
            }
   ```
   The reason being, preventing the state being set as yours does means the 
calls become order-dependent, which they aren't currently, like many calls in 
the engine, i.e you could call settle then disposition and only at that point 
process the transport and get a disposition frame carrying the state and 
settled=true. In general I think being order-dependent is fine and more 
logical, but it wasn't before, and others aren't, so I wonder about changing it 
now.
   
   (It doesn't actually matter for the place this was originally noticed, as 
the two calls are are combined into one and the transport is processed 
afterwards call anyway. I've made a change there that will prevent the state 
being applied if settled, but I do wonder if the same change suits here at the 
lower engine level)
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> applying delivery state to a locally-settled delivery can cause erroneous 
> disposition frame
> -------------------------------------------------------------------------------------------
>
>                 Key: PROTON-2029
>                 URL: https://issues.apache.org/jira/browse/PROTON-2029
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-j
>    Affects Versions: proton-j-0.32.0
>            Reporter: Robbie Gemmell
>            Priority: Minor
>
> If a delivery has disposition state applied and is locally-settled (and the 
> transport output processed), e.g a consumer receiving an unsettled message 
> and acknowledging it, then the unexpected act of applying further delivery 
> state to the delivery object can result in erroneously emitting another 
> disposition frame upon future processing.
> This occurs because applying the state makes adds the delivery to the 
> transport work list again, with the process only being gated on prior 
> remote-settlement to prevent sending a useless notice of settlement. It 
> should also gate on local-settlement to avoid the odd post-settlement state 
> application from actually leading to a disposition frame.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to