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

[protonj2] Message not sent with multiple senders on the same session

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • protonj2-1.0.0-M11
    • protonj2
    • None

    Description

      With the following scenario:

      • create multiple senders on the same session
      • create senders with delivery mode DeliveryMode.AT_MOST_ONCE
      • set a small session outgoing window size so that it can complete under pressure
      • senders do not await settlement
      • send many messages from many senders filling the size of the outgoing window 

      When the outgoing window size is complete, the ClientSender.sendMessage puts the message in a blocking queue and waits for the message to be sent, but when the outgoing window size decreases the ClientSender does not send the message in the blocking queue, and the sendMessage still waits for the message to be sent over the connection.

      With some debugging, it seems the problem is around in the ProtonSender.

      When sending the message, the ClientSender checks ProtonSender.isSendable:

      public boolean isSendable() {
        return sendable && sessionWindow.isSendable();
      } 

      The ProtonSender.sendable is true, but the function returns false because the size of the outgoing window is complete.

      When the outgoing size decreases, it seems the following ProtonSender handler is called:

      ProtonSender handleSessionCreditStateUpdate(ProtonSessionOutgoingWindow protonSessionOutgoingWindow) {
      
              final boolean previousSendable = sendable;
      
              sendable = getCredit() > 0 && sessionWindow.isSendable();
      
              if (previousSendable != sendable) {
                  signalLinkCreditStateUpdated();
              }
      
              return this;
          }
      

      But the signalLinkCreditStateUpdated is not called because the previousSendable and sendable are both true, leaving the message in the blocking queue waiting to be sent.

       

      Attachments

        Activity

          People

            tabish Timothy A. Bish
            mgeri Marco Geri
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: