- client: don't do scheduler-requested RPCs if

- project is set to No New Work, and
    - project has no jobs on the client


svn path=/trunk/boinc/; revision=24348
This commit is contained in:
David Anderson 2011-10-07 21:20:42 +00:00
parent 0e225d889d
commit 57c04979b3
4 changed files with 31 additions and 5 deletions

View File

@ -6935,3 +6935,13 @@ David 7 Oct 2011
client/
app_start.cpp
David 7 Oct 2011
- client: don't do scheduler-requested RPCs if
- project is set to No New Work, and
- project has no jobs on the client
client/
client_types.h
work_fetch.cpp
cs_scheduler.cpp

View File

@ -422,6 +422,7 @@ struct PROJECT : PROJ_AM {
// don't request work from a project if an upload started
// in last X minutes and is still active
bool uploading();
bool has_results();
struct RESULT *next_runnable_result;
// the next result to run for this project

View File

@ -1095,8 +1095,15 @@ PROJECT* CLIENT_STATE::next_project_sched_rpc_pending() {
bool honor_backoff = true;
bool honor_suspend = true;
// is a scheduler-requested RPC due?
//
if (!p->sched_rpc_pending && p->next_rpc_time && p->next_rpc_time<now) {
p->sched_rpc_pending = RPC_REASON_PROJECT_REQ;
// don't do it if project is set to no new work
// and has no jobs currently
//
if (!p->dont_request_more_work || p->has_results()) {
p->sched_rpc_pending = RPC_REASON_PROJECT_REQ;
}
}
switch (p->sched_rpc_pending) {

View File

@ -915,13 +915,21 @@ bool PROJECT::downloading() {
return false;
}
bool PROJECT::has_results() {
for (unsigned i=0; i<gstate.results.size(); i++) {
RESULT *rp = gstate.results[i];
if (rp->project == this) return true;
}
return false;
}
bool PROJECT::some_result_suspended() {
unsigned int i;
for (i=0; i<gstate.results.size(); i++) {
RESULT *rp = gstate.results[i];
if (rp->project != this) continue;
if (rp->suspended_via_gui) return true;
}
RESULT *rp = gstate.results[i];
if (rp->project != this) continue;
if (rp->suspended_via_gui) return true;
}
return false;
}