qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r762370 - in /qpid/trunk/qpid/cpp/src/qpid/cluster: Cluster.cpp Cpg.cpp UpdateClient.cpp
Date Mon, 06 Apr 2009 14:55:57 GMT
Author: aconway
Date: Mon Apr  6 14:55:57 2009
New Revision: 762370

URL: http://svn.apache.org/viewvc?rev=762370&view=rev
Log:
Cluster: fix exception handling if updater fails to connect to  updatee.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=762370&r1=762369&r2=762370&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Mon Apr  6 14:55:57 2009
@@ -316,11 +316,11 @@
     for (const cpg_address* p = a.addrs; p < a.addrs+a.count; ++p) {
         const char* reasonString;
         switch (p->reason) {
-          case CPG_REASON_JOIN: reasonString =  " (joined) "; break;
-          case CPG_REASON_LEAVE: reasonString =  " (left) "; break;
-          case CPG_REASON_NODEDOWN: reasonString =  " (node-down) "; break;
-          case CPG_REASON_NODEUP: reasonString =  " (node-up) "; break;
-          case CPG_REASON_PROCDOWN: reasonString =  " (process-down) "; break;
+          case CPG_REASON_JOIN: reasonString =  "(joined) "; break;
+          case CPG_REASON_LEAVE: reasonString =  "(left) "; break;
+          case CPG_REASON_NODEDOWN: reasonString =  "(node-down) "; break;
+          case CPG_REASON_NODEUP: reasonString =  "(node-up) "; break;
+          case CPG_REASON_PROCDOWN: reasonString =  "(process-down) "; break;
           default: reasonString = " ";
         }
         qpid::cluster::MemberId member(*p);
@@ -342,8 +342,8 @@
         broker.setRecovery(nCurrent == 1);
         initialized = true;
     }
-    QPID_LOG(debug, *this << " config change: " << AddrList(current, nCurrent)

-             << AddrList(left, nLeft, "( ", ")"));
+    QPID_LOG(debug, *this << " config change: " << AddrList(current, nCurrent)
+             << AddrList(left, nLeft, "left: "));
     std::string addresses;
     for (cpg_address* p = current; p < current+nCurrent; ++p) 
         addresses.append(MemberId(*p).str());

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp?rev=762370&r1=762369&r2=762370&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp Mon Apr  6 14:55:57 2009
@@ -77,7 +77,7 @@
     callbacks.cpg_confchg_fn = &globalConfigChange;
     cpg_error_t err = cpg_initialize(&handle, &callbacks);
     if (err == CPG_ERR_TRY_AGAIN) {
-        QPID_LOG(notice, "Waiting for CPG initialization.");
+        QPID_LOG(notice, "Re-trying CPG initialization.");
         while (CPG_ERR_TRY_AGAIN == (err = cpg_initialize(&handle, &callbacks)))
             sys::sleep(5);
     }

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp?rev=762370&r1=762369&r2=762370&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp Mon Apr  6 14:55:57 2009
@@ -98,10 +98,7 @@
       expiry(expiry_), connections(cons), decoder(decoder_),
       connection(catchUpConnection()), shadowConnection(catchUpConnection()),
       done(ok), failed(fail), connectionSettings(cs)
-{
-    connection.open(url, cs);
-    session = connection.newSession(UPDATE);
-}
+{}
 
 UpdateClient::~UpdateClient() {}
 
@@ -110,6 +107,8 @@
 
 void UpdateClient::run() {
     try {
+        connection.open(updateeUrl, connectionSettings);
+        session = connection.newSession(UPDATE);
         update();
         done();
     } catch (const std::exception& e) {



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message