Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-64

Queue.totalIterator() is showing Messages twice when batch of messages pushed address over page threshold

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      When sending a batch of messages using the core protocol. i.e. performing producer.send(message); multiple times then calling session.commit(). The messages are paged twice. This happens when the number of messages in the batch pushes the address over it's max allocated memory and initialises paging on the address.

      If the messages are committed after the paging has started this bug does not surface, nor does it occur if the total messages in the batch do not push the address in paging mode.

      For example.

      I have an address "testAddress" backed up by a queue "testQueue". The max memory on the address is set to 10MB.

      If there are no messages in the queue, hence the total memory usage of the address is <10MB and I send 20 x messages of 1MB, the call session.commit(). The messages that exceed the memory limit are paged twice. Messages 1 - 10 stay in memory, messages 11 - 20 are paged twice.

      This does not happen when the address is already in paging mode. If the address is in paging mode before we send the 20 messages, the server behaves as expected and pages all 20 messages once.

      I have created a test to show this behaviour here: https://github.com/mtaylor/activemq-6/commit/b7bee77bcefb12c4b104c0beb3f4dc9aab545f6b

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            clebertsuconic Clebert Suconic
            martyntaylor Martyn Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment