From 25ca58f5b141b88699aaf3e8680da5a12a85389b Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Sat, 14 Feb 2009 00:47:05 +0000 Subject: Cluster start-up retries to handle slow cman start-up. - infinite retry if cpg_initialize returns TRY_AGAIN. - infinite retry for cman_is_quorate git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@744321 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Quorum_cman.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'cpp/src/qpid/cluster/Quorum_cman.cpp') diff --git a/cpp/src/qpid/cluster/Quorum_cman.cpp b/cpp/src/qpid/cluster/Quorum_cman.cpp index 62c014fcc4..f301f4c877 100644 --- a/cpp/src/qpid/cluster/Quorum_cman.cpp +++ b/cpp/src/qpid/cluster/Quorum_cman.cpp @@ -35,13 +35,10 @@ void Quorum::init() { enable = true; cman = cman_init(0); if (cman == 0) throw ErrnoException("Can't connect to cman service"); - // TODO aconway 2008-11-13: configurable max wait. - for (int retry = 0; !cman_is_quorate(cman) && retry < 30; retry++) { - QPID_LOG(info, "Waiting for cluster quorum: " << sys::strError(errno)); - sys::sleep(1); + if (!cman_is_quorate(cman)) { + QPID_LOG(notice, "Waiting for cluster quorum."); + while(!cman_is_quorate(cman)) sys::sleep(5); } - if (!cman_is_quorate(cman)) - throw ErrnoException("Timed out waiting for cluster quorum."); } bool Quorum::isQuorate() { return enable ? cman_is_quorate(cman) : true; } -- cgit v1.2.1