diff options
author | Alan Conway <aconway@apache.org> | 2011-06-23 13:36:42 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2011-06-23 13:36:42 +0000 |
commit | c6ca02278b68a2490bcfb56ccfac8a0f56c9ac9b (patch) | |
tree | a68e08c2c88e508fd68397e780bc7bf590dcd2f6 | |
parent | 905f1a8753ec8eadea753cf663e1e709568a33fc (diff) | |
download | qpid-python-c6ca02278b68a2490bcfb56ccfac8a0f56c9ac9b.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@1138874 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/broker/SessionState.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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) |