activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [1/2] activemq git commit: fix failing DbRestartJDBCQueueTest
Date Mon, 15 Dec 2014 16:37:15 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 411c7547a -> 13c207292


fix failing DbRestartJDBCQueueTest


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

Branch: refs/heads/trunk
Commit: 13c207292f9df7e730b778ac00e4fe30394ff687
Parents: 2d9959a
Author: gtully <gary.tully@gmail.com>
Authored: Mon Dec 15 14:17:21 2014 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Mon Dec 15 14:21:47 2014 +0000

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


http://git-wip-us.apache.org/repos/asf/activemq/blob/13c20729/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 a6515c4..f5f2efe 100755
--- 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
@@ -937,15 +937,8 @@ public class Queue extends BaseDestination implements Task, UsageListener,
Index
 
     @Override
     public String toString() {
-        int size = 0;
-        messagesLock.readLock().lock();
-        try {
-            size = messages.size();
-        } finally {
-            messagesLock.readLock().unlock();
-        }
         return destination.getQualifiedName() + ", subscriptions=" + consumers.size()
-                + ", memory=" + memoryUsage.getPercentUsage() + "%, size=" + size + ", pending="
+                + ", memory=" + memoryUsage.getPercentUsage() + "%, size=" + destinationStatistics.getMessages().getCount()
+ ", pending="
                 + indexOrderedCursorUpdates.size();
     }
 
@@ -1720,7 +1713,6 @@ public class Queue extends BaseDestination implements Task, UsageListener,
Index
     protected void removeMessage(ConnectionContext context, Subscription sub, final QueueMessageReference
reference,
             MessageAck ack) throws IOException {
         LOG.trace("ack of {} with {}", reference.getMessageId(), ack);
-        reference.setAcked(true);
         // This sends the ack the the journal..
         if (!ack.isInTransaction()) {
             acknowledge(context, sub, ack, reference);
@@ -1759,7 +1751,8 @@ public class Queue extends BaseDestination implements Task, UsageListener,
Index
                 getDestinationStatistics().getForwards().increment();
             }
         }
-
+        // after successful store update
+        reference.setAcked(true);
     }
 
     private void dropMessage(QueueMessageReference reference) {


Mime
View raw message