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/04/01 18:44:23 UTC
activemq git commit: https://issues.apache.org/jira/browse/AMQ-6133
Repository: activemq
Updated Branches:
refs/heads/master 993d56194 -> b2327db3b
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.
Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/b2327db3
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/b2327db3
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/b2327db3
Branch: refs/heads/master
Commit: b2327db3b79dffd42fd5c6ba85720a5d9c302052
Parents: 993d561
Author: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Authored: Fri Apr 1 16:38:17 2016 +0000
Committer: Christopher L. Shannon (cshannon) <ch...@gmail.com>
Committed: Fri Apr 1 16:40:45 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/b2327db3/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 be00a9d..84597b1 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
@@ -833,7 +833,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() {