Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-7107

QueueBrowsingTest and UsageBlockedDispatchTest are failing with ConcurrentStoreAndDispachQueues=false

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 5.16.0
    • Test Cases
    • None

    Description

      Hi,

      I was working towards https://issues.apache.org/jira/browse/AMQ-7028 and after my change QueueBrowsingTest and UsageBlockedDispatchTest were failing.

      QueueBrowsingTest was changed by https://issues.apache.org/jira/browse/AMQ-4495 and it is testing if a full page was pagedIn by the cursor.
      The problem is because this test was only succeeding due how ConcurrentStoreAndDispachQueues=true is implemented. When this flag is set to True, we increase the memory usage when start the async task and when decrease it when the task is done:

      https://github.com/alanprot/activemq/blob/master/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java#L897

      So, imagine this timeline:

      1 . Send message 1

      2. The cursor get full and the cache is disabled

      3. Message1 finish and the memory is freed

      4. messages 2 to 100 are sent and the cache is skipped

      5. We call browser queue and the cursor can pageIn messages because the cursorMemory is not full

      Now with ConcurrentStoreAndDispachQueues=false

      1 . Send message 1

      2 . Send message 2

      3. The cursor get full and the cache is disabled

      4. messages 3 to 100 are sent and the cache is skipped (memory still full)

      5. We call browser queue and the cursor cannot pageIn messages because the cursorMemory is full

      So, in order to make this test work with ConcurrentStoreAndDispachQueues=false i did a simple change on it... After sending all the messages, consume one of them and make sure that the cursor has memory to pageIn messages.

      Similar thing is happening with UsageBlockedDispatchTest.

      I create 2 more test to do the same test with ConcurrentStoreAndDispachQueues=false and changed it a little bit to make them works with this flag false.

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            alanprot Alan Protasio
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m