Qpid
  1. Qpid
  2. QPID-3047

The QueueDepthWithSelectorTest fails on 0-10 profiles

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9
    • Component/s: Java Client
    • Labels:
      None

      Description

      The QueueDepthWithSelector needs refactored to use QpidBrokerTestCase rather than being hardcoded simply the 0-8 iVM broker. Once this is done, the test fails on 0-10 profiles, as the session is not flushing acks correctly.

        Activity

        Hide
        Rajith Attapattu added a comment -

        In AMQSession_0_10.java, when using AUTO_ACK or DUPS_OK the acknowledgements are batched to improve performance.
        The ack are flushed based one of the following conditions (which ever happens first).

        1. When the ack timer fires. The ack-time is configure via qpid.session.max_ack_delay
        2. if un_acked_msg_count > max_prefetch/2.

        For the test case you could force it to ack more frequently by having a smaller prefetch.

        (Please note as per the JMS spec AUTO_ACK should ack each message before it serves up the next message. However by default our AUTO_ACK acts the same as DUPS_OK.)

        Show
        Rajith Attapattu added a comment - In AMQSession_0_10.java, when using AUTO_ACK or DUPS_OK the acknowledgements are batched to improve performance. The ack are flushed based one of the following conditions (which ever happens first). 1. When the ack timer fires. The ack-time is configure via qpid.session.max_ack_delay 2. if un_acked_msg_count > max_prefetch/2. For the test case you could force it to ack more frequently by having a smaller prefetch. (Please note as per the JMS spec AUTO_ACK should ack each message before it serves up the next message. However by default our AUTO_ACK acts the same as DUPS_OK.)
        Hide
        Andrew Kennedy added a comment -

        Understood.

        This fixes the situation where the client is requesting the queue depth, and there are queued up unsent acks because neither 1 or 2 has happenend yet. In this case, the reported queue depth will be wrong, so sending any unflushed acks beforehand is the correct thing to do for this type of synchronous operation.

        Show
        Andrew Kennedy added a comment - Understood. This fixes the situation where the client is requesting the queue depth, and there are queued up unsent acks because neither 1 or 2 has happenend yet. In this case, the reported queue depth will be wrong, so sending any unflushed acks beforehand is the correct thing to do for this type of synchronous operation.
        Hide
        Andrew Kennedy added a comment -

        Ready to review

        Show
        Andrew Kennedy added a comment - Ready to review
        Hide
        Robbie Gemmell added a comment -

        Looks good to me.

        Show
        Robbie Gemmell added a comment - Looks good to me.

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Andrew Kennedy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development