bug fix: with locality scheduling, permit multiple requests

to make work for same file. Bug introduced April 11, 2005.

svn path=/trunk/boinc/; revision=6024
This commit is contained in:
Bruce Allen 2005-05-04 17:17:42 +00:00
parent 835c2090f5
commit 6cb7ecb8c5
2 changed files with 7 additions and 3 deletions

View File

@ -6025,6 +6025,8 @@ Bruce 4 May 2005
- log execution times for two cgi scripts (scheduler and
file_upload_handler)
- better print format for timezone
- bug fix: with locality scheduling, permit multiple requests
to make work for same file. Bug introduced April 11, 2005.
sched/
sched_util.h
@ -6033,4 +6035,5 @@ Bruce 4 May 2005
main.C
sched_send.C
file_upload_handler.C
sched_locality.C

View File

@ -390,7 +390,7 @@ static int send_results_for_file(
) {
DB_RESULT result, prev_result;
char buf[256], query[1024];
int i, maxid, retval_max, retval_lookup, has_slept=0;
int i, maxid, retval_max, retval_lookup, sleep_made_no_work=0;
nsent = 0;
@ -521,13 +521,13 @@ static int send_results_for_file(
// again, or we have already tried to find work for this
// file, we are finished.
//
if (!config.locality_scheduling_wait_period || has_slept) {
if (!config.locality_scheduling_wait_period || sleep_made_no_work) {
break;
}
// wait a bit and try again to find a suitable unsent result
sleep(config.locality_scheduling_wait_period);
has_slept=1;
sleep_made_no_work=1;
} // query_retval
else {
@ -560,6 +560,7 @@ static int send_results_for_file(
// this is only wacky if !one_wu_per_result_per_host.
if (!retval_send) {
nsent++;
sleep_made_no_work=0;
} else if (!config.one_result_per_user_per_wu) {
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
"Database inconsistency? possibly_send_result(%d) failed for [RESULT#%d], returning %d\n",