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 2009/10/05 20:09:34 UTC
svn commit: r821948 - in /qpid/trunk/qpid/cpp/src:
qpid/cluster/ErrorCheck.cpp qpid/cluster/ErrorCheck.h
tests/PartialFailure.cpp
Author: aconway
Date: Mon Oct 5 18:09:34 2009
New Revision: 821948
URL: http://svn.apache.org/viewvc?rev=821948&view=rev
Log:
Minor improvements to cluster logging.
Include the original error message in critical log messages.
Modified:
qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.cpp
qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.h
qpid/trunk/qpid/cpp/src/tests/PartialFailure.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.cpp?rev=821948&r1=821947&r2=821948&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.cpp Mon Oct 5 18:09:34 2009
@@ -45,7 +45,8 @@
}
void ErrorCheck::error(
- Connection& c, ErrorType t, framing::SequenceNumber seq, const MemberSet& ms, const std::string& msg)
+ Connection& c, ErrorType t, framing::SequenceNumber seq, const MemberSet& ms,
+ const std::string& msg)
{
// Detected a local error, inform cluster and set error state.
assert(t != ERROR_TYPE_NONE); // Must be an error.
@@ -54,10 +55,11 @@
unresolved = ms;
frameSeq = seq;
connection = &c;
- QPID_LOG(error, cluster
- << (type == ERROR_TYPE_SESSION ? " channel" : " connection")
- << " error " << frameSeq << " on " << c << ": " << msg
- << " must be resolved with: " << unresolved);
+ message = msg;
+ QPID_LOG(debug, cluster<< (type == ERROR_TYPE_SESSION ? " channel" : " connection")
+ << " error " << frameSeq << " on " << c
+ << " must be resolved with: " << unresolved
+ << ": " << message);
mcast.mcastControl(
ClusterErrorCheckBody(ProtocolVersion(), type, frameSeq), cluster.getId());
// If there are already frames queued up by a previous error, review
@@ -84,13 +86,15 @@
if (errorCheck->getFrameSeq() == frameSeq) { // Addresses current error
next = frames.erase(i); // Drop matching error check controls
if (errorCheck->getType() < type) { // my error is worse than his
- QPID_LOG(critical, cluster << " error " << frameSeq
- << " did not occur on " << i->getMemberId());
- throw Exception(QPID_MSG("Error " << frameSeq
- << " did not occur on all members"));
+ QPID_LOG(critical, cluster
+ << " local error " << frameSeq << " did not occur on member "
+ << i->getMemberId()
+ << ": " << message);
+ throw Exception(
+ QPID_MSG("local error did not occur on all cluster members " << ": " << message));
}
else { // his error is worse/same as mine.
- QPID_LOG(info, cluster << " error " << frameSeq
+ QPID_LOG(debug, cluster << " error " << frameSeq
<< " resolved with " << i->getMemberId());
unresolved.erase(i->getMemberId());
checkResolved();
@@ -128,10 +132,10 @@
void ErrorCheck::checkResolved() {
if (unresolved.empty()) { // No more potentially conflicted members, we're clear.
type = ERROR_TYPE_NONE;
- QPID_LOG(info, cluster << " error " << frameSeq << " resolved.");
+ QPID_LOG(debug, cluster << " error " << frameSeq << " resolved.");
}
else
- QPID_LOG(info, cluster << " error " << frameSeq
+ QPID_LOG(debug, cluster << " error " << frameSeq
<< " must be resolved with " << unresolved);
}
@@ -146,7 +150,7 @@
// Don't respond to non-errors or to my own errors.
if (type == ERROR_TYPE_NONE || from == cluster.getId())
return;
- QPID_LOG(info, cluster << " error " << frameSeq << " did not occur locally.");
+ QPID_LOG(debug, cluster << " error " << frameSeq << " did not occur locally.");
mcast.mcastControl(
ClusterErrorCheckBody(ProtocolVersion(), ERROR_TYPE_NONE, frameSeq),
cluster.getId()
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.h?rev=821948&r1=821947&r2=821948&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/ErrorCheck.h Mon Oct 5 18:09:34 2009
@@ -84,6 +84,7 @@
SequenceNumber frameSeq;
ErrorType type;
Connection* connection;
+ std::string message;
};
}} // namespace qpid::cluster
Modified: qpid/trunk/qpid/cpp/src/tests/PartialFailure.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/PartialFailure.cpp?rev=821948&r1=821947&r2=821948&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/PartialFailure.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/PartialFailure.cpp Mon Oct 5 18:09:34 2009
@@ -93,7 +93,7 @@
c0.session.queueDeclare("q", durable=true);
{
- ScopedSuppressLogging allQuiet;
+ // ScopedSuppressLogging allQuiet;
async(c0.session).messageTransfer(content=pMessage("TEST_STORE_DO: s0[exception]", "q"));
async(c1.session).messageTransfer(content=pMessage("TEST_STORE_DO: s1[exception]", "q"));
@@ -118,7 +118,7 @@
Client c2(cluster[2], "c2");
{
- ScopedSuppressLogging allQuiet;
+ // ScopedSuppressLogging allQuiet;
queueAndSub(c0);
c0.session.messageTransfer(content=Message("x", "c0"));
BOOST_CHECK_EQUAL(c0.lq.get(TIMEOUT).getData(), "x");
@@ -147,7 +147,7 @@
ClusterFixture cluster(1, updateArgs, -1);
Client c0(cluster[0]);
{
- ScopedSuppressLogging allQuiet;
+ // ScopedSuppressLogging allQuiet;
c0.session.queueDeclare("q", durable=true);
c0.session.messageTransfer(content=pMessage("a", "q"));
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org