Skip to content

ARTEMIS-1800 - Fix metrics decrement on scheduled message cancel#2009

Merged
asfgit merged 1 commit into
apache:masterfrom
cshannon:ARTEMIS-1800
Apr 11, 2018
Merged

ARTEMIS-1800 - Fix metrics decrement on scheduled message cancel#2009
asfgit merged 1 commit into
apache:masterfrom
cshannon:ARTEMIS-1800

Conversation

@cshannon
Copy link
Copy Markdown
Contributor

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

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

queueControl.removeAllMessages();

Assert.assertEquals(0, queueControl.getMessageCount());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in a lot of cases, I have had to change this to:

Wait.assertEquals(0, queueuControl::getMessageCount);

Are you sure this is reliable, non asynchronous?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the removeAllMessages() call is synchronous but if it's an issue it's easy enough to switch out the assertion in the test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.. I will just merge it

@asfgit asfgit merged commit 70f0908 into apache:master Apr 11, 2018
asfgit pushed a commit that referenced this pull request Apr 11, 2018
@cshannon cshannon deleted the ARTEMIS-1800 branch February 11, 2020 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants