[
https://issues.apache.org/jira/browse/ARTEMIS-1800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16432793#comment-16432793
]
Christopher L. Shannon commented on ARTEMIS-1800:
-------------------------------------------------
[~jbertram] - I created a PR to fix it, the issue is that the messages are
iterated over again on the remove all cancel and it was calling off to the
decrement logic more than once. However in another case I think we still want
to decrement during the cancel (currently referenced from ScaleDownHandler) so
I made it configurable. There might be another way to fix it as well but this
seemed like the most straight forward.
> 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
> 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)