- client: fix bug in work fetch that caused infinite RPCs

if all projects backed off
- client emulator: disable "fetch master URL" logic
This commit is contained in:
David Anderson 2013-04-08 11:33:49 -07:00
parent 6c1f6f4550
commit 63611be7e8
2 changed files with 5 additions and 1 deletions

View File

@ -357,6 +357,7 @@ bool CLIENT_STATE::simulate_rpc(PROJECT* p) {
html_msg += buf;
msg_printf(p, MSG_INFO, "RPC skipped: project down");
gstate.scheduler_op->project_rpc_backoff(p, "project down");
p->master_url_fetch_pending = false;
return false;
}

View File

@ -671,6 +671,7 @@ PROJECT* WORK_FETCH::choose_project() {
// scan projects in order of decreasing priority
//
bool found = false;
for (unsigned int j=0; j<gstate.projects.size(); j++) {
p = gstate.projects[j];
DEBUG(msg_printf(p, MSG_INFO, "scanning");)
@ -743,18 +744,20 @@ PROJECT* WORK_FETCH::choose_project() {
rwf.set_request_excluded(p);
}
}
found = true;
break;
} else {
p = NULL;
}
}
if (p) {
if (found) {
p->sched_rpc_pending = RPC_REASON_NEED_WORK;
} else {
if (log_flags.work_fetch_debug) {
msg_printf(0, MSG_INFO, "[work_fetch] No project chosen for work fetch");
}
p = NULL;
}
return p;