diff options
author | Alan Conway <aconway@apache.org> | 2009-04-06 14:55:57 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2009-04-06 14:55:57 +0000 |
commit | cfb5d33487829f2b63e3fa08c3ba0c41b526158c (patch) | |
tree | 8b6c283d271cda76dbb700c10a246f9834f46ec7 /cpp/src | |
parent | 557e3ceb4cec0bbbfb62700afdf0f3c96aeb64f5 (diff) | |
download | qpid-python-cfb5d33487829f2b63e3fa08c3ba0c41b526158c.tar.gz |
Cluster: fix exception handling if updater fails to connect to updatee.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@762370 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 14 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/Cpg.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/UpdateClient.cpp | 7 |
3 files changed, 11 insertions, 12 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index f8e412f1e6..38a41c36e8 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -316,11 +316,11 @@ ostream& operator<<(ostream& o, const AddrList& a) { 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 @@ void Cluster::configChange ( 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()); diff --git a/cpp/src/qpid/cluster/Cpg.cpp b/cpp/src/qpid/cluster/Cpg.cpp index 915a578989..d93b671619 100644 --- a/cpp/src/qpid/cluster/Cpg.cpp +++ b/cpp/src/qpid/cluster/Cpg.cpp @@ -77,7 +77,7 @@ Cpg::Cpg(Handler& h) : IOHandle(new sys::IOHandlePrivate), handler(h), isShutdow 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); } diff --git a/cpp/src/qpid/cluster/UpdateClient.cpp b/cpp/src/qpid/cluster/UpdateClient.cpp index 97eae7efa3..c00b811a20 100644 --- a/cpp/src/qpid/cluster/UpdateClient.cpp +++ b/cpp/src/qpid/cluster/UpdateClient.cpp @@ -98,10 +98,7 @@ UpdateClient::UpdateClient(const MemberId& updater, const MemberId& updatee, con 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 @@ const std::string UpdateClient::UPDATE("qpid.cluster-update"); void UpdateClient::run() { try { + connection.open(updateeUrl, connectionSettings); + session = connection.newSession(UPDATE); update(); done(); } catch (const std::exception& e) { |