MemoryUsage not properly accounted for when expiring messages to DLQ: can lead 
to hang.
---------------------------------------------------------------------------------------

                 Key: AMQ-2487
                 URL: https://issues.apache.org/activemq/browse/AMQ-2487
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.4.0
         Environment: N/A
            Reporter: Colin MacNaughton
             Fix For: 5.4.0


Given the following broker destination policy
{code:xml} 
    <destinationPolicy>
      <policyMap>
        <policyEntries>
          <policyEntry topic=">" producerFlowControl="true"
            memoryLimit="1mb">
            <pendingSubscriberPolicy>
              <vmCursor />
            </pendingSubscriberPolicy>
          </policyEntry>
          <policyEntry queue=">" producerFlowControl="true"
            memoryLimit="1mb">
            <!--
              Use VM cursor for better latency For more information,
              see: http://activemq.apache.org/message-cursors.html
            -->
            <pendingQueuePolicy>
              <vmQueueCursor />
            </pendingQueuePolicy>
          </policyEntry>
        </policyEntries>
      </policyMap>
    </destinationPolicy>
{code}

If I send message to queue://TESTQ1 with an expiration of 1second, with an 
unreliable/slow receiver, the publisher eventually hangs sending to the queue. 
The underlying problem is that when the message is expired to the DLQ the 
MemoryUsage reference is left pointing the TESTQ1's memory limiter, instead of 
being reset to the DLQ limiter, and when it is added to the DLQ, TESTQ1's 
memory limiter is updated counteracting the decrement that is done by the 
TESTQ1 when the message is expired. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to