diff options
| author | Alan Conway <aconway@apache.org> | 2008-11-28 17:59:20 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-11-28 17:59:20 +0000 |
| commit | 16578074ba43ea5858c85be75665222a4af526e8 (patch) | |
| tree | e892cba64289b1268f2cd116f1663d30c734c5f9 /qpid/cpp | |
| parent | 3dd6228348a124acc2865be5828d4ba1fb7e898f (diff) | |
| download | qpid-python-16578074ba43ea5858c85be75665222a4af526e8.tar.gz | |
Added cluster log messages.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@721542 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/cluster/Cluster.cpp | 17 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp | 21 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/cluster/OutputInterceptor.h | 1 |
3 files changed, 18 insertions, 21 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Cluster.cpp b/qpid/cpp/src/qpid/cluster/Cluster.cpp index 7db4e1a3b9..a881516597 100644 --- a/qpid/cpp/src/qpid/cluster/Cluster.cpp +++ b/qpid/cpp/src/qpid/cluster/Cluster.cpp @@ -208,8 +208,7 @@ void Cluster::leave(Lock&) { } try { broker.shutdown(); } catch (const std::exception& e) { - QPID_LOG(critical, *this << " error during shutdown, aborting: " << e.what()); - abort(); // Big trouble. + QPID_LOG(critical, *this << " error during shutdown: " << e.what()); } } } @@ -218,7 +217,7 @@ boost::intrusive_ptr<Connection> Cluster::getConnection(const ConnectionId& conn ConnectionMap::iterator i = connections.find(connectionId); if (i == connections.end()) { if (connectionId.getMember() == myId) { // Closed local connection - QPID_LOG(warning, *this << " attempt to use closed connection " << connectionId); + QPID_LOG(debug, *this << " activity on closed connection: " << connectionId); return boost::intrusive_ptr<Connection>(); } else { // New shadow connection @@ -343,7 +342,11 @@ void Cluster::dispatch(sys::DispatchHandle& h) { // Entry point: called if disconnected from CPG. void Cluster::disconnect(sys::DispatchHandle& ) { QPID_LOG(critical, *this << " error disconnected from cluster"); - broker.shutdown(); + try { + broker.shutdown(); + } catch (const std::exception& e) { + QPID_LOG(error, *this << " error in shutdown: " << e.what()); + } } void Cluster::configChange ( @@ -382,7 +385,7 @@ void Cluster::configChange(const MemberId&, const std::string& addresses, Lock& } else { // Joining established group. state = NEWBIE; - QPID_LOG(info, *this << " request state dump"); + QPID_LOG(info, *this << " joining established cluster"); mcastControl(ClusterDumpRequestBody(ProtocolVersion(), myUrl.str()), l); } } @@ -427,7 +430,7 @@ void Cluster::ready(const MemberId& id, const std::string& url, Lock& l) { memberUpdate(l); if (state == CATCHUP && id == myId) { state = READY; - QPID_LOG(notice, *this << " caught up"); + QPID_LOG(notice, *this << " caught up, active cluster member"); if (mgmtObject!=0) mgmtObject->set_status("ACTIVE"); for_each(mcastQueue.begin(), mcastQueue.end(), boost::bind(&Cluster::mcast, this, _1, boost::ref(l))); mcastQueue.clear(); @@ -542,7 +545,7 @@ void Cluster::stopFullCluster(Lock& l) { } void Cluster::memberUpdate(Lock& l) { - QPID_LOG(debug, *this << " member update, map=" << map); + QPID_LOG(info, *this << " member update, map=" << map); std::vector<Url> urls = getUrls(l); size_t size = urls.size(); failoverExchange->setUrls(urls); diff --git a/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp b/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp index 68afb9bda0..0563899a1c 100644 --- a/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp +++ b/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp @@ -46,12 +46,11 @@ void OutputInterceptor::send(framing::AMQFrame& f) { void OutputInterceptor::activateOutput() { Locker l(lock); - if (parent.isCatchUp()) next->activateOutput(); else { + QPID_LOG(trace, parent << " activateOutput - sending doOutput"); moreOutput = true; - QPID_LOG(trace, &parent << " activateOutput - sending doOutput"); sendDoOutput(); } } @@ -59,10 +58,13 @@ void OutputInterceptor::activateOutput() { // Called in write thread when the IO layer has no more data to write. // We do nothing in the write thread, we run doOutput only on delivery // of doOutput requests. -bool OutputInterceptor::doOutput() { return false; } +bool OutputInterceptor::doOutput() { + QPID_LOG(trace, parent << " write idle."); + return false; +} // Delivery of doOutput allows us to run the real connection doOutput() -// which stocks up the write buffers with data. +// which tranfers frames to the codec for writing. // void OutputInterceptor::deliverDoOutput(size_t requested) { Locker l(lock); @@ -81,20 +83,13 @@ void OutputInterceptor::deliverDoOutput(size_t requested) { QPID_LOG(trace, "Delivered doOutput: requested=" << requested << " output=" << sent << " more=" << moreOutput); if (parent.isLocal() && moreOutput) { - QPID_LOG(trace, &parent << " deliverDoOutput - sending doOutput, more output available."); + QPID_LOG(trace, parent << " deliverDoOutput - sending doOutput, more output available."); sendDoOutput(); } else doingOutput = false; } -void OutputInterceptor::startDoOutput() { - if (!doingOutput) { - QPID_LOG(trace, &parent << " startDoOutput - sending doOutput, more output available."); - sendDoOutput(); - } -} - // Send a doOutput request if one is not already in flight. void OutputInterceptor::sendDoOutput() { // Call with lock held. @@ -109,7 +104,7 @@ void OutputInterceptor::sendDoOutput() { // // FIXME aconway 2008-10-16: use ++parent.mcastSeq as sequence no,not 0 parent.getCluster().mcastControl(ClusterConnectionDeliverDoOutputBody(ProtocolVersion(), request), parent.getId(), 0); - QPID_LOG(trace, &parent << "Send doOutput request for " << request); + QPID_LOG(trace, parent << "Send doOutput request for " << request); } void OutputInterceptor::setOutputHandler(sys::ConnectionOutputHandler& h) { diff --git a/qpid/cpp/src/qpid/cluster/OutputInterceptor.h b/qpid/cpp/src/qpid/cluster/OutputInterceptor.h index 17ab5bbc55..f4226d3a40 100644 --- a/qpid/cpp/src/qpid/cluster/OutputInterceptor.h +++ b/qpid/cpp/src/qpid/cluster/OutputInterceptor.h @@ -58,7 +58,6 @@ class OutputInterceptor : public sys::ConnectionOutputHandler { private: typedef sys::Mutex::ScopedLock Locker; - void startDoOutput(); void sendDoOutput(); mutable sys::Mutex lock; |
