cpg_initialize often fails with a CS_ERR_TRY_AGAIN error. We should retry in such case.
Signed-off-by: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp> --- sheep/cluster/corosync.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/sheep/cluster/corosync.c b/sheep/cluster/corosync.c index b3f6471..02130f3 100644 --- a/sheep/cluster/corosync.c +++ b/sheep/cluster/corosync.c @@ -731,8 +731,16 @@ static int corosync_init(const char *option) .cpg_confchg_fn = cdrv_cpg_confchg }; +again: ret = cpg_initialize(&cpg_handle, &cb); - if (ret != CS_OK) { + switch (ret) { + case CS_OK: + /* success */ + break; + case CS_ERR_TRY_AGAIN: + dprintf("retry cpg_initialize\n"); + goto again; + default: eprintf("failed to initialize cpg (%d) - " "is corosync running?\n", ret); return -1; -- 1.7.2.5 -- sheepdog mailing list sheepdog@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/sheepdog