You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2011/06/23 15:36:42 UTC

svn commit: r1138874 - /qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp

Author: aconway
Date: Thu Jun 23 13:36:42 2011
New Revision: 1138874

URL: http://svn.apache.org/viewvc?rev=1138874&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp?rev=1138874&r1=1138873&r2=1138874&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp Thu Jun 23 13:36:42 2011
@@ -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(Sequen
                                   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)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org