diff --git a/checkin_notes b/checkin_notes index def1a73f74..d58346051a 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8350,3 +8350,23 @@ Charlie 14 Oct 2008 ViewProjects.cpp,.h ViewTransfers.cpp,.h ViewWork.cpp,.h + +David 14 Oct 2008 + - client: clarify and fix the semantics of "next RPC time". + Here's are the new semantics: a scheduler reply can include + + Make another RPC ASAP after this amount of time elapses. + This is specified by the element in config.xml. + + Don't make another RPC until this amount of time elapses. + This is sent automatically (and sometimes with large delays) + by various parts of the scheduler. + next_rpc_delay now "overrides" request_delay in the sense that + request_delay is ignored if it's greater than next_rpc_delay. + + In addition: the client maintains a min_rpc_time which is set based + on request_delay and also by various exponential backoff schemes. + new_rpc_delay now overrides this as well, in the same sense. + client/ + cs_scheduler.cpp + work_fetch.cpp diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index 406b4e8f84..3f82680cf6 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -864,6 +864,15 @@ int CLIENT_STATE::handle_scheduler_reply( print_summary(); } + // the following must precede the backoff and request_delay checks, + // since it overrides them + // + if (sr.next_rpc_delay) { + project->next_rpc_time = now + sr.next_rpc_delay; + } else { + project->next_rpc_time = 0; + } + // if we asked for work and didn't get any, // treat it as an RPC failure; back off this project // @@ -874,19 +883,11 @@ int CLIENT_STATE::handle_scheduler_reply( project->min_rpc_time = 0; } - // handle delay request from project - // if (sr.request_delay) { double x = now + sr.request_delay; project->set_min_rpc_time(x, "requested by project"); } - if (sr.next_rpc_delay) { - project->next_rpc_time = now + sr.next_rpc_delay; - } else { - project->next_rpc_time = 0; - } - return 0; } diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 8ea866c3aa..7b6a688f00 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -97,16 +97,16 @@ void CLIENT_STATE::check_project_timeout() { } void PROJECT::set_min_rpc_time(double future_time, const char* reason) { - if (future_time > min_rpc_time) { - min_rpc_time = future_time; - possibly_backed_off = true; - if (log_flags.sched_op_debug) { - msg_printf(this, MSG_INFO, - "[sched_op_debug] Deferring communication for %s", - timediff_format(min_rpc_time - gstate.now).c_str() - ); - msg_printf(this, MSG_INFO, "[sched_op_debug] Reason: %s\n", reason); - } + if (future_time <= min_rpc_time) return; + if (next_rpc_time && (future_time > next_rpc_time)) return; + min_rpc_time = future_time; + possibly_backed_off = true; + if (log_flags.sched_op_debug) { + msg_printf(this, MSG_INFO, + "[sched_op_debug] Deferring communication for %s", + timediff_format(min_rpc_time - gstate.now).c_str() + ); + msg_printf(this, MSG_INFO, "[sched_op_debug] Reason: %s\n", reason); } } @@ -134,7 +134,6 @@ PROJECT* CLIENT_STATE::next_project_master_pending() { } // find a project for which a scheduler RPC is pending -// and we're not backed off // PROJECT* CLIENT_STATE::next_project_sched_rpc_pending() { unsigned int i; @@ -142,10 +141,14 @@ PROJECT* CLIENT_STATE::next_project_sched_rpc_pending() { for (i=0; iwaiting_until_min_rpc_time()) continue; + + // project request overrides backoff + // if (p->next_rpc_time && p->next_rpc_timesched_rpc_pending = RPC_REASON_PROJECT_REQ; p->next_rpc_time = 0; + } else { + if (p->waiting_until_min_rpc_time()) continue; } // if (p->suspended_via_gui) continue; // do the RPC even if suspended. @@ -764,15 +767,18 @@ double RESULT::estimated_cpu_time_uncorrected() { // estimate how long a result will take on this host // -double RESULT::estimated_cpu_time(bool for_work_fetch) { #ifdef SIM +double RESULT::estimated_cpu_time(bool for_work_fetch) { SIM_PROJECT* spp = (SIM_PROJECT*)project; if (dual_dcf && for_work_fetch && spp->completions_ratio_mean) { return estimated_cpu_time_uncorrected()*spp->completions_ratio_mean; } -#endif +} +#else +double RESULT::estimated_cpu_time(bool) { return estimated_cpu_time_uncorrected()*project->duration_correction_factor; } +#endif double RESULT::estimated_cpu_time_remaining(bool for_work_fetch) { if (computing_done()) return 0;