summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-04-22 21:13:05 +0000
committerAlan Conway <aconway@apache.org>2009-04-22 21:13:05 +0000
commit6ece508e0a4e50fc1ae22a00cf9f7f742e1d985e (patch)
tree920e397ad77269d1ac9942fddc9c6760a7ccd49f /qpid/cpp
parentac423e626b4d619dc31531b4135a0fa0aabee057 (diff)
downloadqpid-python-6ece508e0a4e50fc1ae22a00cf9f7f742e1d985e.tar.gz
Better logging around cpg_init, 30 second retry limit.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@767663 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/cluster/Cpg.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Cpg.cpp b/qpid/cpp/src/qpid/cluster/Cpg.cpp
index d93b671619..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) {
+ 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() {