* [Patch 10/12] tabled: retry initial CLD session open etc.
@ 2010-04-18 4:43 Pete Zaitcev
0 siblings, 0 replies; only message in thread
From: Pete Zaitcev @ 2010-04-18 4:43 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Project Hail List
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@redhat.com>
---
server/cldu.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
commit a922bf8ae3137d1b8adc83b52c816f6334dd7291
Author: Master <zaitcev@lembas.zaitcev.lan>
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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-04-18 4:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-18 4:43 [Patch 10/12] tabled: retry initial CLD session open etc Pete Zaitcev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.