Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-971

[proton-j] multi-frame deliveries may be broken when sent if buffered along with a futher delivery for the same link



    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • proton-0.10
    • proton-0.11.0
    • proton-j
    • None


      Proton-j sends at most a single frame for a delivery in each call to "processTransportWorkSender(DeliveryImpl delivery, SenderImpl snd)", which occurs for each sent delivery on the 'transport work list' in turn during the "processTransportWork" call. That call is made twice for each process of the transport. As such, at most 2 frames for each delivery can be emitted for each process of the transport. However, because all deliveries on the connections 'transport work list' are processed in turn by "processTransportWork", it is possible that interleaved transfer frames for subsequent deliveries on the same link will also be emitted if there are other buffered deliveries on the work list and the session window and frame writer 'isFUll' checks permit it.

      This in itself would already be illegal [1] even if the frames were otherwise correct, but the erroenous transfer frames also get marked with the wrong delivery-id since that is only incremented by the transport when a delivery has been completed, so if it was not all sent yet then the initial/interleaved transfer frames for the subsequent delivery are also stamped with the same id. Proton-j uses the delivery-id while consitituting received deliveries, and thus the mismatch results in interleaving of the payload from the later delivery within that for the earlier delivery.

      [1] http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#doc-idp484080
      "However, messages transferred along a single link MUST NOT be interleaved."


        1. PROTON-971_test.patch
          2 kB
          Robbie Gemmell



            robbie Robbie Gemmell
            robbie Robbie Gemmell
            0 Vote for this issue
            4 Start watching this issue