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

ActiveMQ locks out new consumers/producers during queue GC

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.10.1, 5.11.0
    • Fix Version/s: None
    • Component/s: Broker
    • Labels:
      None

      Description

      ActiveMQ supports a feature where it can GC a queue that is inactive. IE now messages and no consumers.

      However, there’s a bug where

      purgeInactiveDestinations

      in

      org.apache.activemq.broker.region.RegionBroker

      creates a read/write lock (inactiveDestinationsPurgeLock) which is held during the entire queue GC.

      each individual queue GC takes about 100ms with a disk backed queue and 10ms with a memory backed (non-persistent) queue. If you have thousands of them to GC at once the inactiveDestinationsPurgeLock lock is held the entire time which can last from 60 seconds to 5 minutes (and essentially unbounded).

      A read lock is also held for this in addConsumer addProducer so that when a new consumer or produce tries to connect, they’re blocked until queue GC completes.

      Existing producers/consumers work JUST fine.

      The lock MUST be held on each queue because if it isn’t there’s a race where a queue is flagged to be GCd , then a producer comes in and writes a new message, then the background thread deletes the queue which it marked as GCable but it had the newly produced message. This would result in data loss.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              burtonator Kevin Burton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: