From ba68f452a0135010ae1550c917cea60b27e66c40 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 24 May 2013 20:11:14 -0700 Subject: [PATCH] server: fix bug related to job-size matching Problem: a workunit could error out with unsent results. The feeder skips such results, but the size_regulator counts them and doesn't so doesn't promote any new results. Solution: the feeder scans for results even with workunit errors. If marks these results as state OVER, outcome DIDNT_NEED --- db/boinc_db.cpp | 1 - sched/feeder.cpp | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/db/boinc_db.cpp b/db/boinc_db.cpp index 5380a81776..15c46f0cf6 100644 --- a/db/boinc_db.cpp +++ b/db/boinc_db.cpp @@ -1868,7 +1868,6 @@ int DB_WORK_ITEM::enumerate( " and r1.workunitid=workunit.id " " and workunit.appid=app.id " " and app.deprecated=0 " - " and workunit.error_mask=0 " " and workunit.transitioner_flags=0 " " %s " " %s " diff --git a/sched/feeder.cpp b/sched/feeder.cpp index 7fd746b3c2..a590e37110 100644 --- a/sched/feeder.cpp +++ b/sched/feeder.cpp @@ -300,6 +300,24 @@ static bool get_job_from_db( continue; } + // if the WU had an error, mark result as DIDNT_NEED + // + if (wi.wu.error_mask) { + char buf[256]; + DB_RESULT result; + result.id = wi.res_id; + sprintf(buf, "server_state=%d, outcome=%d", + RESULT_SERVER_STATE_OVER, + RESULT_OUTCOME_DIDNT_NEED + ); + result.update_field(buf); + log_messages.printf(MSG_NORMAL, + "[RESULT#%u] WU had error, marking as DIDNT_NEED\n", + wi.res_id + ); + continue; + } + // Check for collision (i.e. this result already is in the array) // collision = false;