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 2008/11/28 18:59:21 UTC

svn commit: r721542 - in /incubator/qpid/trunk/qpid/cpp/src/qpid/cluster: Cluster.cpp OutputInterceptor.cpp OutputInterceptor.h

Author: aconway
Date: Fri Nov 28 09:59:20 2008
New Revision: 721542

URL: http://svn.apache.org/viewvc?rev=721542&view=rev
Log:
Added cluster log messages.

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=721542&r1=721541&r2=721542&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Fri Nov 28 09:59:20 2008
@@ -208,8 +208,7 @@
         }
         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 @@
     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 @@
 // 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 @@
         }
         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 @@
         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::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);

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp?rev=721542&r1=721541&r2=721542&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp Fri Nov 28 09:59:20 2008
@@ -46,12 +46,11 @@
 
 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 @@
 // 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 @@
     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 @@
     //
     // 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) {

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h?rev=721542&r1=721541&r2=721542&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h Fri Nov 28 09:59:20 2008
@@ -58,7 +58,6 @@
   private:
     typedef sys::Mutex::ScopedLock Locker;
 
-    void startDoOutput();
     void sendDoOutput();
 
     mutable sys::Mutex lock;