diff options
author | Alan Conway <aconway@apache.org> | 2009-04-22 21:13:05 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2009-04-22 21:13:05 +0000 |
commit | b980fe5458169f20ed04dfeacb1d3bf2312b8101 (patch) | |
tree | d29502d1f3e3edfc3b62ef07f4cf40f6ad3ba1ee /cpp | |
parent | 94b8ad6e617cfc9fc90abae667cff679d766fef5 (diff) | |
download | qpid-python-b980fe5458169f20ed04dfeacb1d3bf2312b8101.tar.gz |
Better logging around cpg_init, 30 second retry limit.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@767663 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/cluster/Cpg.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpp/src/qpid/cluster/Cpg.cpp b/cpp/src/qpid/cluster/Cpg.cpp index d93b671619..f746eacea4 100644 --- a/cpp/src/qpid/cluster/Cpg.cpp +++ b/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) { + int retries = 6; + while (err == CPG_ERR_TRY_AGAIN && --retries) { QPID_LOG(notice, "Re-trying CPG initialization."); - while (CPG_ERR_TRY_AGAIN == (err = cpg_initialize(&handle, &callbacks))) - sys::sleep(5); + 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() { |