- client: reorganize and improve the logic for deciding

when to do a scheduler RPC:
    if user request or acct mgr request, ignore backoff and suspend via GUI;
    in all other cases honor both of these.

svn path=/trunk/boinc/; revision=17503
This commit is contained in:
David Anderson 2009-03-04 22:55:57 +00:00
parent 5cf568a180
commit c750daed46
3 changed files with 44 additions and 14 deletions

View File

@ -2637,3 +2637,13 @@ David 4 Mar 2009
sched/
sched_driver.cpp
sched_util.cpp
David 4 Mar 2009
- client: reorganize and improve the logic for deciding
when to do a scheduler RPC:
if user request or acct mgr request, ignore backoff and suspend via GUI;
in all other cases honor both of these.
client/
cs_scheduler.cpp
scheduler_op.cpp

View File

@ -1006,20 +1006,40 @@ PROJECT* CLIENT_STATE::next_project_sched_rpc_pending() {
for (i=0; i<projects.size(); i++) {
p = projects[i];
if (p->sched_rpc_pending == RPC_REASON_USER_REQ) {
// honor user request even if backed off
//
return p;
}
if (p->waiting_until_min_rpc_time()) continue;
bool honor_backoff = true;
bool honor_suspend = true;
if (p->next_rpc_time && p->next_rpc_time<now) {
if (!p->sched_rpc_pending && p->next_rpc_time && p->next_rpc_time<now) {
p->sched_rpc_pending = RPC_REASON_PROJECT_REQ;
}
// if (p->suspended_via_gui) continue;
// do the RPC even if suspended.
// This is critical for acct mgrs, to propagate new host CPIDs
//
switch (p->sched_rpc_pending) {
case RPC_REASON_USER_REQ:
honor_backoff = false;
honor_suspend = false;
break;
case RPC_REASON_RESULTS_DUE:
break;
case RPC_REASON_NEED_WORK:
break;
case RPC_REASON_TRICKLE_UP:
break;
case RPC_REASON_ACCT_MGR_REQ:
// This is critical for acct mgrs, to propagate new host CPIDs
honor_backoff = false;
honor_suspend = false;
break;
case RPC_REASON_INIT:
break;
case RPC_REASON_PROJECT_REQ:
break;
}
if (honor_backoff && p->waiting_until_min_rpc_time()) {
continue;
}
if (honor_suspend && p->suspended_via_gui) {
continue;
}
if (p->sched_rpc_pending) {
return p;
}

View File

@ -187,14 +187,14 @@ void SCHEDULER_OP::backoff(PROJECT* p, const char *reason_msg) {
// RPC failed, either on startup or later.
// If RPC was requested by project or acct mgr, or init,
// keep trying (subject to backoff); otherwise give up
// (the results_dur, need_work, and trickle_up cases will be retriggered)
// keep trying (subject to backoff); otherwise give up.
// The other cases (results_dur, need_work, project req, and trickle_up)
// will be retriggered automatically
//
void SCHEDULER_OP::rpc_failed(const char* msg) {
backoff(cur_proj, msg);
switch (cur_proj->sched_rpc_pending) {
case RPC_REASON_INIT:
case RPC_REASON_PROJECT_REQ:
case RPC_REASON_ACCT_MGR_REQ:
break;
default: