From: probe Date: Fri, 17 Jul 1992 15:10:59 +0000 (+0000) Subject: Adjusted retry delay of failed prdb updates from 2 to 5 seconds. X-Git-Tag: release77~472 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/5d391e44399763080a78151967ecd25794c8e304?ds=sidebyside;hp=96786144188eb5b57a4e54c2e0e655ce884c0185 Adjusted retry delay of failed prdb updates from 2 to 5 seconds. --- diff --git a/incremental/afs.c b/incremental/afs.c index 7bd9f33b..6b61ec5e 100644 --- a/incremental/afs.c +++ b/incremental/afs.c @@ -22,7 +22,8 @@ #include #define STOP_FILE "/moira/afs/noafs" -#define TRY_PR 2 +#define PR_TRIES 2 +#define PR_DELAY 5 #define file_exists(file) (access((file), F_OK) == 0) @@ -160,10 +161,10 @@ int afterc; /* Only a modify has to be done */ tries = 0; while (code=pr_ChangeEntry(before[U_NAME], after[U_NAME], auid, "")) { - if (++tries > TRY_PR) + if (++tries > PR_TRIES) break; if (code == UNOQUORUM) { sleep(90); continue; } - sleep(2); + sleep(PR_DELAY); } if (code) { critical_alert("incremental", @@ -176,10 +177,10 @@ int afterc; if (bstate == 1) { tries = 0; while (code = pr_DeleteByID(buid)) { - if (++tries > TRY_PR) + if (++tries > PR_TRIES) break; if (code == UNOQUORUM) { sleep(90); continue; } - sleep(2); + sleep(PR_DELAY); } if (code && code != PRNOENT) { critical_alert("incremental", @@ -191,10 +192,10 @@ int afterc; if (astate == 1) { tries = 0; while (code = pr_CreateUser(after[U_NAME], &auid)) { - if (++tries > TRY_PR) + if (++tries > PR_TRIES) break; if (code == UNOQUORUM) { sleep(90); continue; } - sleep(2); + sleep(PR_DELAY); } if (code) { critical_alert("incremental", @@ -272,10 +273,10 @@ int afterc; strcat(g2, after[L_NAME]); tries = 0; while (code = pr_ChangeEntry(g1, g2, -agid, "")) { - if (++tries > TRY_PR) + if (++tries > PR_TRIES) break; if (code == UNOQUORUM) { sleep(90); continue; } - sleep(2); + sleep(PR_DELAY); } if (code) { critical_alert("incremental", @@ -290,10 +291,10 @@ int afterc; (-agid, PR_SF_ALLBITS, (ahide ?PRP_STATUS_ANY :PRP_GROUP_DEFAULT)>>PRIVATE_SHIFT, 0 /*ngroups*/, 0 /*nusers*/)) { - if (++tries > TRY_PR) + if (++tries > PR_TRIES) break; if (code == UNOQUORUM) { sleep(90); continue; } - sleep(2); + sleep(PR_DELAY); } if (code) { critical_alert("incremental", @@ -306,10 +307,10 @@ int afterc; if (bgid) { tries = 0; while (code = pr_DeleteByID(-bgid)) { - if (++tries > TRY_PR) + if (++tries > PR_TRIES) break; if (code == UNOQUORUM) { sleep(90); continue; } - sleep(2); + sleep(PR_DELAY); } if (code && code != PRNOENT) { critical_alert("incremental", @@ -325,10 +326,10 @@ int afterc; id = -agid; tries = 0; while (code = pr_CreateGroup(g1, g2, &id)) { - if (++tries > TRY_PR) + if (++tries > PR_TRIES) break; if (code == UNOQUORUM) { sleep(90); continue; } - sleep(2); + sleep(PR_DELAY); } if (code) { critical_alert("incremental", @@ -342,10 +343,10 @@ int afterc; (-agid, PR_SF_ALLBITS, (ahide ?PRP_STATUS_ANY :PRP_GROUP_DEFAULT)>>PRIVATE_SHIFT, 0 /*ngroups*/, 0 /*nusers*/)) { - if (++tries > TRY_PR) + if (++tries > PR_TRIES) break; if (code == UNOQUORUM) { sleep(90); continue; } - sleep(2); + sleep(PR_DELAY); } if (code) { critical_alert("incremental", @@ -459,10 +460,10 @@ edit_group(op, group, type, member) strcat(buf, group); sleep(1); /* give ptserver some time */ while (code = (*fn)(member, buf)) { - if (++tries > TRY_PR) + if (++tries > PR_TRIES) break; if (code == UNOQUORUM) { sleep(90); continue; } - sleep(2); + sleep(PR_DELAY); } if (code) { if (op==0 && code == PRNOENT) return;