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 2016/12/05 12:27:29 UTC

activemq git commit: Revert AMQ-5659

Repository: activemq
Updated Branches:
  refs/heads/master 0f0bdb21e -> 3f7ca8406


Revert AMQ-5659

Add safety measure against infinite loop when store exception prevents message removal. Thanks to metatechbe for the patch. This fixes #72."

This reverts commit 78492febc858ff06c1ef42e49cdfefc39a6855fb.


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

Branch: refs/heads/master
Commit: 3f7ca8406d33556c4148bdf590e534698382ad92
Parents: 0f0bdb2
Author: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Authored: Mon Dec 5 07:26:59 2016 -0500
Committer: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Committed: Mon Dec 5 07:26:59 2016 -0500

----------------------------------------------------------------------
 .../org/apache/activemq/broker/region/Queue.java     | 15 ---------------
 1 file changed, 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/3f7ca840/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 409c978..6a42ebc 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
@@ -1239,8 +1239,6 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
     public void purge() throws Exception {
         ConnectionContext c = createConnectionContext();
         List<MessageReference> list = null;
-        long previousDequeueCount = -1;
-        long previousDequeueCountRepeated = 1L;
         long originalMessageCount = this.destinationStatistics.getMessages().getCount();
         do {
             doPageIn(true, false, getMaxPageSize());  // signal no expiry processing needed.
@@ -1252,19 +1250,6 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
             }
 
             for (MessageReference ref : list) {
-                long currentDequeueCount = this.destinationStatistics.getDequeues().getCount();
-                if (previousDequeueCount == currentDequeueCount) {
-                    previousDequeueCountRepeated++;
-                    if (previousDequeueCountRepeated >= 3) {
-                        // Break the infinite loop in case the removal fails
-                        // 3 times in a row -> error is fatal and not transient.
-                        LOG.error("Aborted purge operation after attempting to delete messages failed 3 times in a row (to avoid endless looping)");
-                        throw new RuntimeException("Purge operation failed to delete messages failed 3 times in a row (to avoid endless looping)");
-                    }
-                } else {
-                    previousDequeueCount = currentDequeueCount;
-                    previousDequeueCountRepeated = 0L;
-                }
                 try {
                     QueueMessageReference r = (QueueMessageReference) ref;
                     removeMessage(c, r);