summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/ErrorCheck.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-07-31 18:40:26 +0000
committerAlan Conway <aconway@apache.org>2009-07-31 18:40:26 +0000
commit30057848b8044a31631a55b768cc0675b56811d4 (patch)
tree966afc9c78dcfe18f3d9b2d5d19073e668499eb9 /cpp/src/qpid/cluster/ErrorCheck.h
parent0a26b8c9543e066a19c8b457f41425972eb0b0c4 (diff)
downloadqpid-python-30057848b8044a31631a55b768cc0675b56811d4.tar.gz
Fix race condition in cluster error handling.
If different errors occured almost simultaneously on two different nodes in a cluster, there was a race condition that could cause the cluster to hang. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@799687 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/ErrorCheck.h')
-rw-r--r--cpp/src/qpid/cluster/ErrorCheck.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/cpp/src/qpid/cluster/ErrorCheck.h b/cpp/src/qpid/cluster/ErrorCheck.h
index 550cd36b75..09028391ac 100644
--- a/cpp/src/qpid/cluster/ErrorCheck.h
+++ b/cpp/src/qpid/cluster/ErrorCheck.h
@@ -25,6 +25,7 @@
#include "qpid/cluster/types.h"
#include "qpid/cluster/Multicaster.h"
#include "qpid/framing/enum.h"
+#include "qpid/framing/SequenceNumber.h"
#include <boost/function.hpp>
#include <deque>
#include <set>
@@ -49,11 +50,12 @@ class ErrorCheck
public:
typedef std::set<MemberId> MemberSet;
typedef framing::cluster::ErrorType ErrorType;
+ typedef framing::SequenceNumber SequenceNumber;
ErrorCheck(Cluster&);
/** A local error has occured */
- void error(Connection&, ErrorType, uint64_t frameSeq, const MemberSet&,
+ void error(Connection&, ErrorType, SequenceNumber frameSeq, const MemberSet&,
const std::string& msg);
/** Called when a frame is delivered */
@@ -66,7 +68,8 @@ class ErrorCheck
bool isUnresolved() const { return type != NONE; }
-
+ /** Respond to an error check saying we had no error. */
+ void respondNone(const MemberId&, uint8_t type, SequenceNumber frameSeq);
private:
static const ErrorType NONE = framing::cluster::ERROR_TYPE_NONE;
@@ -78,7 +81,7 @@ class ErrorCheck
Multicaster& mcast;
FrameQueue frames;
MemberSet unresolved;
- uint64_t frameSeq;
+ SequenceNumber frameSeq;
ErrorType type;
Connection* connection;
};