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

queue.send() throws ResourceAllocationException without checking usageManager when sendFailIfNoSpace is set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.1.2
    • 5.1.0
    • Broker
    • None

    Description

      org.apache.activemq.broker.region.Queue send(ConnectionContext, Message) method always throws ResourceAllocationException if sendFailIfNoSpace is set, producerFlowControl is enabled, message response is not required and network connection is not used to connect to broker.

      In this case thread execution ends up in following code block:

                  ... 
                  } else { 
                      if (usageManager.isSendFailIfNoSpace() ) { 
                          throw new javax.jms.ResourceAllocationException("Usage Manager memory limit reached"); 
                      } else { 
                          while( !usageManager.waitForSpace(1000) ) { 
                              if( context.getStopping().get() ) 
                                  throw new IOException("Connection closed, send aborted."); 
                          } 
                      } 
                  } 
      

      ... usageManager is never checked for space prior to throwing ResourceAllocationException("Usage Manager memory limit reached"), and no message can be sent to this queue, regardless of the usageManager set on queue.

      Attachments

        Activity

          People

            rajdavies Robert Davies
            mlukica Mario Lukica
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: