Qpid
  1. Qpid
  2. QPID-3487

Client should send completions when closing a receiver

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.13
    • Component/s: C++ Client
    • Labels:
      None

      Description

      When closing a receiver for a queue that is either delete:always or auto-delete:true, it is possible for the queue to remain visible in management (qmf) even though the client has already acknowledged, released, or rejected all messages.

      Steps to reproduce:

      1) Create receiver e.g. my-queue; {create:always, delete:always, node: {x-declare:

      {auto-delete: true}

      }}
      2) Set capacity to something e.g. 10
      3) Send messages to my-queue
      4) Call get() on the receiver for each message
      5) Ack/release/reject each message
      6) Close the receiver
      7) IMPORTANT: keep the session alive

      Expected results: "qpid-stat -q" will not show my-queue in the list

      Actual results: "qpid-stat -q" shows my-queue in the list

      This happens because the broker has instances of DeliveryRecord in memory for each message that the receiver acquired, and each DeliveryRecord has a shared_ptr to the Queue. Because the receiver does not necessarily send completions for all the message.transfer commands, DeliveryRecords will still be around, which means the Queue will still be visible via management.

        Activity

        Justin Ross made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gordon Sim made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Gordon Sim [ gsim ]
        Fix Version/s 0.13 [ 12316854 ]
        Resolution Fixed [ 1 ]
        Hide
        Gordon Sim added a comment -

        I believe the correct fix here is to ensure the broker cleans up delivery records for any ended transfers as and when the subscription is cancelled. There is no need to keep them around pending completion as credit tracking is no longer a concern. This also fixes the possibility at present of having delivery records get 'stuck' in the list, never completed as the consumer is cancelled.

        Show
        Gordon Sim added a comment - I believe the correct fix here is to ensure the broker cleans up delivery records for any ended transfers as and when the subscription is cancelled. There is no need to keep them around pending completion as credit tracking is no longer a concern. This also fixes the possibility at present of having delivery records get 'stuck' in the list, never completed as the consumer is cancelled.
        Andy Goldstein created issue -

          People

          • Assignee:
            Gordon Sim
            Reporter:
            Andy Goldstein
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development