diff options
| author | Alan Conway <aconway@apache.org> | 2009-02-14 00:47:05 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2009-02-14 00:47:05 +0000 |
| commit | 25ca58f5b141b88699aaf3e8680da5a12a85389b (patch) | |
| tree | b0bea41066c325e5771dca988bddce165f020932 /cpp/src/qpid/cluster/Quorum_cman.cpp | |
| parent | 858b69ff7c0ad5bf938e3817497a1b7953bf76d5 (diff) | |
| download | qpid-python-25ca58f5b141b88699aaf3e8680da5a12a85389b.tar.gz | |
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
Diffstat (limited to 'cpp/src/qpid/cluster/Quorum_cman.cpp')
| -rw-r--r-- | cpp/src/qpid/cluster/Quorum_cman.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
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; } |
