From c6ca02278b68a2490bcfb56ccfac8a0f56c9ac9b Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 23 Jun 2011 13:36:42 +0000 Subject: QPID-3121: Cluster management inconsistency when using persistent store. With the recent changes to asynchronous completion, completeRcvMsg can be called immediately by the thread that enqueues the message or deferred as an IO Callback till after journal threads are done with the message. The choice between these two options is unpredicatable, so the ordering of management events generated during completeRcvMsg unpredictalbe and can cause an inconsistency error when completeRcvMsg updates connection stats. The fix is to mark completeRcvMsg as a cluster-unsafe scope so no management messages will be generated regardless of how it is called. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1138874 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/broker/SessionState.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/broker/SessionState.cpp b/qpid/cpp/src/qpid/broker/SessionState.cpp index 119e5732c4..ee9646931e 100644 --- a/qpid/cpp/src/qpid/broker/SessionState.cpp +++ b/qpid/cpp/src/qpid/broker/SessionState.cpp @@ -25,6 +25,7 @@ #include "qpid/broker/SessionManager.h" #include "qpid/broker/SessionHandler.h" #include "qpid/broker/RateFlowcontrol.h" +#include "qpid/sys/ClusterSafe.h" #include "qpid/sys/Timer.h" #include "qpid/framing/AMQContentBody.h" #include "qpid/framing/AMQHeaderBody.h" @@ -322,6 +323,11 @@ void SessionState::completeRcvMsg(SequenceNumber id, bool requiresAccept, bool requiresSync) { + // Mark this as a cluster-unsafe scope since it can be called in + // journal threads or connection threads as part of asynchronous + // command completion. + sys::ClusterUnsafeScope cus; + bool callSendCompletion = false; receiverCompleted(id); if (requiresAccept) -- cgit v1.2.1