activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject activemq git commit: AMQ-6947 - Make sure counters are updated correct on message drop
Date Tue, 17 Apr 2018 12:26:37 GMT
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.15.x 0036084af -> 1fe096cb2


AMQ-6947 - Make sure counters are updated correct on message drop

Only update metrics counters when message is removed from the
pagedInMessages list which is important to check in case of duplicates

(cherry picked from commit 021c82859cf4361eb31b21fdbac17655ae9e368d)


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/1fe096cb
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/1fe096cb
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/1fe096cb

Branch: refs/heads/activemq-5.15.x
Commit: 1fe096cb2a3ec03dbf5a7aab05c0960f8c739339
Parents: 0036084
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Tue Apr 17 08:23:59 2018 -0400
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Tue Apr 17 08:25:56 2018 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/activemq/broker/region/Queue.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/1fe096cb/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
index 48cbfbe..2946ac5 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
@@ -1839,11 +1839,12 @@ public class Queue extends BaseDestination implements Task, UsageListener,
Index
     private void dropMessage(QueueMessageReference reference) {
         //use dropIfLive so we only process the statistics at most one time
         if (reference.dropIfLive()) {
-            getDestinationStatistics().getDequeues().increment();
-            getDestinationStatistics().getMessages().decrement();
             pagedInMessagesLock.writeLock().lock();
             try {
-                pagedInMessages.remove(reference);
+                if (pagedInMessages.remove(reference) != null) {
+                    getDestinationStatistics().getDequeues().increment();
+                    getDestinationStatistics().getMessages().decrement();
+                }
             } finally {
                 pagedInMessagesLock.writeLock().unlock();
             }


Mime
View raw message