activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6133
Date Fri, 01 Apr 2016 16:52:11 GMT
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.13.x 7f5c09f2d -> 8393e6b8e


https://issues.apache.org/jira/browse/AMQ-6133

Disabling async queue message store when persistJMSRedelivered is turned
on for a destination.  That flag will cause a sync update later on
dispatch which can cause a race condition if the original message add is
processed after the update.  This can cause a duplicate message to be
stored.

(cherry picked from commit b2327db3b79dffd42fd5c6ba85720a5d9c302052)


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

Branch: refs/heads/activemq-5.13.x
Commit: 8393e6b8ea6cb9953f54cec80df46b8c181c7e7f
Parents: 7f5c09f
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Fri Apr 1 16:38:17 2016 +0000
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Fri Apr 1 16:51:20 2016 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/activemq/broker/region/Queue.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/8393e6b8/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 c8c7c33..cf53b51 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
@@ -835,7 +835,11 @@ public class Queue extends BaseDestination implements Task, UsageListener,
Index
                 if (store != null && message.isPersistent()) {
                     message.getMessageId().setFutureOrSequenceLong(null);
                     try {
-                        if (messages.isCacheEnabled()) {
+                        //AMQ-6133 - don't store async if using persistJMSRedelivered
+                        //This flag causes a sync update later on dispatch which can cause
a race
+                        //condition if the original add is processed after the update, which
can cause
+                        //a duplicate message to be stored
+                        if (messages.isCacheEnabled() && !isPersistJMSRedelivered())
{
                             result = store.asyncAddQueueMessage(context, message, isOptimizeStorage());
                             final PendingMarshalUsageTracker tracker = new PendingMarshalUsageTracker(message);
                             result.addListener(new Runnable() {


Mime
View raw message