summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SessionState.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-06-23 13:36:42 +0000
committerAlan Conway <aconway@apache.org>2011-06-23 13:36:42 +0000
commit36fc63d0921b3e09f9775d964228fa683826d7cb (patch)
tree120c22331662d5505c6a97dd63cd397369f16cf3 /cpp/src/qpid/broker/SessionState.cpp
parentab3cfbea51d2844cb1a21e4f2660a59f54d228d3 (diff)
downloadqpid-python-36fc63d0921b3e09f9775d964228fa683826d7cb.tar.gz
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/qpid@1138874 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionState.cpp')
-rw-r--r--cpp/src/qpid/broker/SessionState.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/SessionState.cpp b/cpp/src/qpid/broker/SessionState.cpp
index 119e5732c4..ee9646931e 100644
--- a/cpp/src/qpid/broker/SessionState.cpp
+++ b/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)