You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cs...@apache.org on 2018/04/18 16:34:48 UTC

[1/2] activemq git commit: Revert "AMQ-6947 - Update Queue metrics on expiration"

Repository: activemq
Updated Branches:
  refs/heads/master 6e468b454 -> 1d2226e6c


Revert "AMQ-6947 - Update Queue metrics on expiration"

This reverts commit 6e468b4540754cad5cd30de373cadc026c998669.


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

Branch: refs/heads/master
Commit: 7123534e1b1c82f5358f5a12f7498c0562696c92
Parents: 6e468b4
Author: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Authored: Wed Apr 18 12:34:07 2018 -0400
Committer: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Committed: Wed Apr 18 12:34:07 2018 -0400

----------------------------------------------------------------------
 .../java/org/apache/activemq/broker/region/Queue.java  | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/7123534e/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 4aa8f7b..64f1da2 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
@@ -1872,7 +1872,8 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
             pagedInMessagesLock.writeLock().lock();
             try {
                 if (pagedInMessages.remove(reference) != null) {
-                    updateMetricsOnMessageDrop();
+                    getDestinationStatistics().getDequeues().increment();
+                    getDestinationStatistics().getMessages().decrement();
                 }
             } finally {
                 pagedInMessagesLock.writeLock().unlock();
@@ -1880,11 +1881,6 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
         }
     }
 
-    private void updateMetricsOnMessageDrop() {
-        getDestinationStatistics().getDequeues().increment();
-        getDestinationStatistics().getMessages().decrement();
-    }
-
     public void messageExpired(ConnectionContext context, MessageReference reference) {
         messageExpired(context, null, reference);
     }
@@ -2041,11 +2037,6 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
                         if (processExpired && ref.isExpired()) {
                             if (broker.isExpired(ref)) {
                                 messageExpired(createConnectionContext(), ref);
-
-                                //We need to update the metrics here because the drop message
-                                //method will only update if the message was removed from the
-                                //pagedInMessages list which won't happen in this case
-                                updateMetricsOnMessageDrop();
                             } else {
                                 ref.decrementReferenceCount();
                             }


[2/2] activemq git commit: Revert "AMQ-6947 - Make sure counters are updated correct on message drop"

Posted by cs...@apache.org.
Revert "AMQ-6947 - Make sure counters are updated correct on message drop"

This reverts commit 021c82859cf4361eb31b21fdbac17655ae9e368d.


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

Branch: refs/heads/master
Commit: 1d2226e6cfc110c0b8456f9c5775ce1a6cdf0ac5
Parents: 7123534
Author: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Authored: Wed Apr 18 12:34:18 2018 -0400
Committer: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Committed: Wed Apr 18 12:34:18 2018 -0400

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


http://git-wip-us.apache.org/repos/asf/activemq/blob/1d2226e6/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 64f1da2..ff55e2f 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
@@ -1869,12 +1869,11 @@ 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 {
-                if (pagedInMessages.remove(reference) != null) {
-                    getDestinationStatistics().getDequeues().increment();
-                    getDestinationStatistics().getMessages().decrement();
-                }
+                pagedInMessages.remove(reference);
             } finally {
                 pagedInMessagesLock.writeLock().unlock();
             }