diff --git a/checkin_notes b/checkin_notes index 881e5fef40..9ebcb9ccf3 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index 5184dd49e4..2b2c4f3d40 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -1006,20 +1006,40 @@ PROJECT* CLIENT_STATE::next_project_sched_rpc_pending() { for (i=0; isched_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_timesched_rpc_pending && p->next_rpc_time && p->next_rpc_timesched_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; } diff --git a/client/scheduler_op.cpp b/client/scheduler_op.cpp index 4c8103f340..7f218fa531 100644 --- a/client/scheduler_op.cpp +++ b/client/scheduler_op.cpp @@ -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: