From fdb23707352b96986daf36db3b47538a307a2888 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 18 Jun 2009 21:25:00 +0000 Subject: Make error-check a cluster-connection control rather than a cluster control. Fixes bug if an error occurs during update. As cluster controls, error-checks were being processed out of sequence with the connection data they referred to. Making them connection controls ensures they are processed in the proper order. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@786294 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Connection.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/cluster/Connection.cpp') diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp index 2db8879eb5..42cb9556fb 100644 --- a/cpp/src/qpid/cluster/Connection.cpp +++ b/cpp/src/qpid/cluster/Connection.cpp @@ -38,6 +38,7 @@ #include "qpid/framing/ClusterConnectionDeliverCloseBody.h" #include "qpid/framing/ConnectionCloseBody.h" #include "qpid/framing/ConnectionCloseOkBody.h" +#include "qpid/framing/ClusterConnectionErrorCheckBody.h" #include "qpid/log/Statement.h" #include @@ -54,7 +55,7 @@ namespace qpid { namespace cluster { using namespace framing; -using namespace framing::cluster; +using namespace framing::cluster_connection; qpid::sys::AtomicValue Connection::catchUpId(0x5000000000000000LL); @@ -444,5 +445,19 @@ void Connection::connectionError(const std::string& ) { cluster.flagError(*this, ERROR_TYPE_CONNECTION); } +void Connection::errorCheck(uint8_t type, uint64_t frameSeq) { + // If we handle an errorCheck at this point (rather than in the + // ErrorCheck class) then we have processed succesfully past the + // point of the error so respond with ERROR_TYPE_NONE + if (type != ERROR_TYPE_NONE) { // Don't respond to NONE. + QPID_LOG(debug, cluster << " error " << frameSeq << " on " << *this + << " did not occur locally."); + cluster.getMulticast().mcastControl( + ClusterConnectionErrorCheckBody( + ProtocolVersion(), ERROR_TYPE_NONE, frameSeq), self); + } +} + + }} // namespace qpid::cluster -- cgit v1.2.1