This was an error in the conversion to ncld. In the cldc code, we kick the state machine and the natural retries do the rest. Any failures occure there. But in ncld the original kick can fail too. Five retries give CLD server time to reboot. If it's down, then clients refuse to start. This may be a bad idea, or may be not. We may yet change the retries to be infinite, but for now it's better if builds terminate somehow in case of unexpected problems. Also, is_dead should not be cleared if a retry timeout is scheduled. Signed-off-by: Pete Zaitcev <zaitcev@xxxxxxxxxx> --- server/cldu.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) commit a922bf8ae3137d1b8adc83b52c816f6334dd7291 Author: Master <zaitcev@xxxxxxxxxxxxxxxxxx> Date: Sat Apr 17 20:38:12 2010 -0600 The CLD client fixes from Chunk (keep is_dead is most important). diff --git a/server/cldu.c b/server/cldu.c index a10b8fe..e247f45 100644 --- a/server/cldu.c +++ b/server/cldu.c @@ -157,14 +157,16 @@ static void cldu_tm_rescan(int fd, short events, void *userdata) applog(LOG_DEBUG, "Rescanning for Chunks in %s", sp->xfname); if (sp->is_dead) { - ncld_sess_close(sp->nsp); - sp->nsp = NULL; - sp->is_dead = false; + if (sp->nsp) { + ncld_sess_close(sp->nsp); + sp->nsp = NULL; + } newactive = cldu_nextactive(sp); if (cldu_set_cldc(sp, newactive)) { evtimer_add(&sp->tm_rescan, &cldu_rescan_delay); return; } + sp->is_dead = false; } scan_chunks(sp); @@ -589,6 +591,7 @@ int cld_begin(const char *thishost, const char *thisgroup, int verbose) { static struct cld_session *sp = &ses; struct timespec tm; + int newactive; int retry_cnt; cldu_hail_log.verbose = verbose; @@ -635,9 +638,15 @@ int cld_begin(const char *thishost, const char *thisgroup, int verbose) * -- Actually, it only works when recovering from CLD failure. * Thereafter, any slave CLD redirects us to the master. */ - if (cldu_set_cldc(sp, 0)) { + newactive = 0; + retry_cnt = 0; + for (;;) { + if (!cldu_set_cldc(sp, newactive)) + break; /* Already logged error */ - goto err_net; + if (++retry_cnt == 5) + goto err_net; + newactive = cldu_nextactive(sp); } retry_cnt = 0; -- To unsubscribe from this list: send the line "unsubscribe hail-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html