From 82091ce825923252d7a224ebf771be61e8dd15a2 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 30 Jun 2009 20:51:38 +0000 Subject: Fix cluster race condition with connections closed by broker while in use. If a client is using a connection that is closed at the broker end because of an error, there is a race condition that allows the connection to be incorrectly re-created on replica brokers which can cause those brokers to exit with an error that does not occur on the directly connected broker. The fix: explicitly announce new connections, shadow connections are no longer implicitly created on first use. Make error-check a cluster control so it can be handled independently of the lifecycle of the connection where an error initially occured. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@789947 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/ErrorCheck.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpp/src/qpid/cluster/ErrorCheck.cpp') diff --git a/cpp/src/qpid/cluster/ErrorCheck.cpp b/cpp/src/qpid/cluster/ErrorCheck.cpp index 9c2ba9c61a..abb361bbb5 100644 --- a/cpp/src/qpid/cluster/ErrorCheck.cpp +++ b/cpp/src/qpid/cluster/ErrorCheck.cpp @@ -22,7 +22,7 @@ #include "EventFrame.h" #include "ClusterMap.h" #include "Cluster.h" -#include "qpid/framing/ClusterConnectionErrorCheckBody.h" +#include "qpid/framing/ClusterErrorCheckBody.h" #include "qpid/framing/ClusterConfigChangeBody.h" #include "qpid/log/Statement.h" @@ -33,7 +33,7 @@ namespace cluster { using namespace std; using namespace framing; -using namespace framing::cluster_connection; +using namespace framing::cluster; ErrorCheck::ErrorCheck(Cluster& c) : cluster(c), mcast(c.getMulticast()), frameSeq(0), type(ERROR_TYPE_NONE), connection(0) @@ -56,14 +56,14 @@ void ErrorCheck::error(Connection& c, ErrorType t, uint64_t seq, const MemberSet QPID_LOG(debug, cluster << (type == ERROR_TYPE_SESSION ? " Session" : " Connection") << " error " << frameSeq << " unresolved: " << unresolved); mcast.mcastControl( - ClusterConnectionErrorCheckBody(ProtocolVersion(), type, frameSeq), c.getId()); + ClusterErrorCheckBody(ProtocolVersion(), type, frameSeq), c.getId().getMember()); } void ErrorCheck::delivered(const EventFrame& e) { if (isUnresolved()) { - const ClusterConnectionErrorCheckBody* errorCheck = 0; + const ClusterErrorCheckBody* errorCheck = 0; if (e.frame.getBody()) - errorCheck = dynamic_cast( + errorCheck = dynamic_cast( e.frame.getMethod()); if (errorCheck && errorCheck->getFrameSeq() == frameSeq) { // Same error if (errorCheck->getType() < type) { // my error is worse than his -- cgit v1.2.1