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

Queue.start() does not call systemUsage.start() so TempStore usage is not handled correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.15.6
    • 5.15.9, 5.16.0
    • Broker
    • None
    • Patch Available
    • Patch, Important

    Description

      I have an application using ActiveMQ and have a situation where a producer is blocked with this log message due to the temp usage limit being hit:

      [ActiveMQ Transport: tcp:///aaa.bbb.ccc.ddd:65119@64759] 82567721 INFO  org.apache.activemq.broker.region.Queue - Usage(Main:temp:queue://aaabbb:temp) percentUsage=99%, usage=61771109932, limit=61771104256, percentUsageMinDelta=1%;Parent:Usage(Main:temp) percentUsage=100%, usage=61771109932, limit=61771104256, percentUsageMinDelta=1%: Temp Store is Full (99% of 61771104256). Stopping producer (ID:aaaaa-3:1:1:1) to prevent flooding queue://aaabbb. See http://activemq.apache.org/producer-flow-control.html for more info (blocking for: 8512s)

      In the past I have been able to use JConsole and update the broker's TempLimit value to a higher value to allow things to continue.
       
      However on this occasion, the messages above when output again show that the parent's temp limit has updated however the child's limit (the queue) is unchanged.  So it seems the broker's TempUsage does not know about the queue's TempUsage. 
       
      In looking at the code.. it seems a child Usage class has to call start() in order for this parent -> children link to be established and for parent limit changes to be propagated down to children.  However the Queue start() method doesn't call systemUsage.getTempUsage().start() for some reason (or even just systemUsage.start()).
       
      Is this a bug?
       
      DestinationView sadly does not expose setTempLimit() either so this wasn't an option either.
       
      From Queue:

          @Override
          public void start() throws Exception {
              if (started.compareAndSet(false, true)) {
                  if (memoryUsage != null) {
                      memoryUsage.start();
                  }
                  if (systemUsage.getStoreUsage() != null) {
                      systemUsage.getStoreUsage().start();
                  }
                  systemUsage.getMemoryUsage().addUsageListener(this);
                  messages.start();
                  if (getExpireMessagesPeriod() > 0) {
                      scheduler.executePeriodically(expireMessagesTask, getExpireMessagesPeriod());
                  }
                  doPageIn(false);
              }
          }

         

      Attachments

        1. AQM-7085.patch
          13 kB
          David Sitsky

        Issue Links

          Activity

            People

              cshannon Christopher L. Shannon
              sits David Sitsky
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: