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
This commit is contained in:
David Anderson 2013-05-24 20:11:14 -07:00
parent 8dfb6dbc1b
commit ba68f452a0
2 changed files with 18 additions and 1 deletions

View File

@ -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 "

View File

@ -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;