[ https://issues.apache.org/jira/browse/ARTEMIS-1800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16432877#comment-16432877 ]
ASF GitHub Bot commented on ARTEMIS-1800: ----------------------------------------- GitHub user cshannon opened a pull request: https://github.com/apache/activemq-artemis/pull/2009 ARTEMIS-1800 - Fix metrics decrement on scheduled message cancel The queue metrics were being decremented improperly because on iteration over the cancelled scheduled messages because the flag for fromMessageReferences was not set to false. Setting the flag to false skips over the metrics update which is what we want as the scheduled messages were never added to the message references in the first place so the metrics don't need updating You can merge this pull request into a Git repository by running: $ git pull https://github.com/cshannon/activemq-artemis ARTEMIS-1800 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/activemq-artemis/pull/2009.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2009 ---- commit 70f0908b4ee64e68059a21009db9dd3236c26732 Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@...> Date: 2018-04-10T19:54:29Z ARTEMIS-1800 - Fix metrics decrement on scheduled message cancel The queue metrics were being decremented improperly because on iteration over the cancelled scheduled messages because the flag for fromMessageReferences was not set to false. Setting the flag to false skips over the metrics update which is what we want as the scheduled messages were never added to the message references in the first place so the metrics don't need updating ---- > Incorrect number of messages on queue after remove of scheduled message > ----------------------------------------------------------------------- > > Key: ARTEMIS-1800 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1800 > Project: ActiveMQ Artemis > Issue Type: Bug > Affects Versions: 2.5.0 > Reporter: Justin Bertram > Assignee: Christopher L. Shannon > Priority: Major > > This will reproduce the failure if added to > {{org.apache.activemq.artemis.tests.integration.management.QueueControlTest}}: > {noformat} > @Test > public void testGetScheduledCountOnRemove() throws Exception { > long delay = Integer.MAX_VALUE; > SimpleString address = RandomUtil.randomSimpleString(); > SimpleString queue = RandomUtil.randomSimpleString(); > session.createQueue(address, RoutingType.MULTICAST, queue, null, > durable); > QueueControl queueControl = createManagementControl(address, queue); > Assert.assertEquals(0, queueControl.getScheduledCount()); > ClientProducer producer = session.createProducer(address); > ClientMessage message = session.createMessage(durable); > message.putLongProperty(Message.HDR_SCHEDULED_DELIVERY_TIME, > System.currentTimeMillis() + delay); > producer.send(message); > queueControl.removeAllMessages(); > Assert.assertEquals(0, queueControl.getMessageCount()); > session.deleteQueue(queue); > } > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)