diff options
Diffstat (limited to 'qpid/cpp/src/qpid/cluster/Cpg.cpp')
-rw-r--r-- | qpid/cpp/src/qpid/cluster/Cpg.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Cpg.cpp b/qpid/cpp/src/qpid/cluster/Cpg.cpp index 915a578989..f746eacea4 100644 --- a/qpid/cpp/src/qpid/cluster/Cpg.cpp +++ b/qpid/cpp/src/qpid/cluster/Cpg.cpp @@ -75,11 +75,14 @@ Cpg::Cpg(Handler& h) : IOHandle(new sys::IOHandlePrivate), handler(h), isShutdow ::memset(&callbacks, sizeof(callbacks), 0); callbacks.cpg_deliver_fn = &globalDeliver; callbacks.cpg_confchg_fn = &globalConfigChange; + + QPID_LOG(info, "Initializing CPG"); cpg_error_t err = cpg_initialize(&handle, &callbacks); - if (err == CPG_ERR_TRY_AGAIN) { - QPID_LOG(notice, "Waiting for CPG initialization."); - while (CPG_ERR_TRY_AGAIN == (err = cpg_initialize(&handle, &callbacks))) - sys::sleep(5); + int retries = 6; + while (err == CPG_ERR_TRY_AGAIN && --retries) { + QPID_LOG(notice, "Re-trying CPG initialization."); + sys::sleep(5); + err = cpg_initialize(&handle, &callbacks); } check(err, "Failed to initialize CPG."); check(cpg_context_set(handle, this), "Cannot set CPG context"); @@ -87,7 +90,6 @@ Cpg::Cpg(Handler& h) : IOHandle(new sys::IOHandlePrivate), handler(h), isShutdow // windows then this needs to be refactored into // qpid::sys::<platform> IOHandle::impl->fd = getFd(); - QPID_LOG(debug, "Initialized CPG handle 0x" << std::hex << handle); } Cpg::~Cpg() { |