Qpid Proton
  1. Qpid Proton
  2. PROTON-116

Proton sends explicit disposition for pre-settled messages

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.2
    • Fix Version/s: 0.5
    • Component/s: proton-c
    • Labels:
      None

      Description

      When proton sends pre-settled messages (the settled flag is set in the transfer), it follows up with an explicit disposition frame for the message.

      I believe this disposition update is spurious and unneeded, though I haven't found a definitive statement one way or the other in the protocol specification.

      [0x1efaaa0:1] -> FLOW @19 [0, 1024, 0, 1024, 1, 0, 8, null, false]
      [0x1efaaa0:1] <- TRANSFER @20 [1, 0, b"\x00\x00\x00\x00\x00\x00\x00\x00", 0, true, false] (184)
      [0x1efaaa0:1] <- TRANSFER @20 [1, 1, b"\x01\x00\x00\x00\x00\x00\x00\x00", 0, true, false] (184)
      [0x1efaaa0:1] <- TRANSFER @20 [1, 2, b"\x02\x00\x00\x00\x00\x00\x00\x00", 0, true, false] (184)
      [0x1efaaa0:1] <- DISPOSITION @21 [false, 0, 2, true, null]

        Activity

        Hide
        Rafael H. Schloming added a comment -

        It's not illegal to send the spurious disposition, however you're correct that it's not needed.

        Show
        Rafael H. Schloming added a comment - It's not illegal to send the spurious disposition, however you're correct that it's not needed.
        Hide
        ASF subversion and git services added a comment -

        Commit 1491871 from rhs@apache.org
        [ https://svn.apache.org/r1491871 ]

        PROTON-116: avoid sending redundant disposition frames

        Show
        ASF subversion and git services added a comment - Commit 1491871 from rhs@apache.org [ https://svn.apache.org/r1491871 ] PROTON-116 : avoid sending redundant disposition frames
        Hide
        Gordon Sim added a comment -

        This change appears to cause a delivery to continually be returned from the work queue until it is settled. I.e. where the messages arrive with the settled falg false, and the application code then handles the readbale message and advances (but doesn't yet settle or update the message), then the delivery keeps getting returned (in updated state).

        The following change 'fixes' it for me to behave as before, can't say for sure if this is right or not:

        Index: proton-c/src/engine/engine.c
        ===================================================================
        --- proton-c/src/engine/engine.c	(revision 1499474)
        +++ proton-c/src/engine/engine.c	(working copy)
        @@ -1813,8 +1813,10 @@
         
             // XXX: need to fill in remote state: delivery->remote.state = ...;
             delivery->remote.settled = settled;
        -    delivery->updated = true;
        -    pn_work_update(transport->connection, delivery);
        +    if (settled) {
        +      delivery->updated = true;
        +      pn_work_update(transport->connection, delivery);
        +    }
           }
         
           pn_buffer_append(delivery->bytes, disp->payload, disp->size);
        

        I can raise a separate JIRA if desired.

        Show
        Gordon Sim added a comment - This change appears to cause a delivery to continually be returned from the work queue until it is settled. I.e. where the messages arrive with the settled falg false, and the application code then handles the readbale message and advances (but doesn't yet settle or update the message), then the delivery keeps getting returned (in updated state). The following change 'fixes' it for me to behave as before, can't say for sure if this is right or not: Index: proton-c/src/engine/engine.c =================================================================== --- proton-c/src/engine/engine.c (revision 1499474) +++ proton-c/src/engine/engine.c (working copy) @@ -1813,8 +1813,10 @@ // XXX: need to fill in remote state: delivery->remote.state = ...; delivery->remote.settled = settled; - delivery->updated = true; - pn_work_update(transport->connection, delivery); + if (settled) { + delivery->updated = true; + pn_work_update(transport->connection, delivery); + } } pn_buffer_append(delivery->bytes, disp->payload, disp->size); I can raise a separate JIRA if desired.
        Hide
        Gordon Sim added a comment -

        My 'fix' attached, since formatting doesn't seem to work as expected in comments.

        Show
        Gordon Sim added a comment - My 'fix' attached, since formatting doesn't seem to work as expected in comments.
        Hide
        ASF subversion and git services added a comment -

        Commit 1502588 from Gordon Sim
        [ https://svn.apache.org/r1502588 ]

        PROTON-116: only mark delivery updated if it has been presettled

        Show
        ASF subversion and git services added a comment - Commit 1502588 from Gordon Sim [ https://svn.apache.org/r1502588 ] PROTON-116 : only mark delivery updated if it has been presettled

          People

          • Assignee:
            Rafael H. Schloming
            Reporter:
            Ted Ross
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development