From 3f8792bf2ae89f2a20d37f3a8cad1acf8a08bd1d Mon Sep 17 00:00:00 2001 From: Bruce Allen Date: Thu, 1 Jun 2006 13:51:10 +0000 Subject: [PATCH] scheduler: clearer messages to use if refusing to accept a result. DB purger: make sleep interval a command line option (current 600 secs is still the default value). svn path=/trunk/boinc/; revision=10236 --- checkin_notes | 11 +++++++++++ sched/db_purge.C | 16 ++++++++++++++-- sched/handle_request.C | 16 ++++++++-------- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/checkin_notes b/checkin_notes index f76a1dd332..e21249789b 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5339,3 +5339,14 @@ Rom 1 June 2006 api/ boinc_api.C + +Bruce 1 June 2006 + - scheduler: clearer messages to use if refusing to accept a result. + - DB purger: make sleep interval a command line option (current 600 + secs is still the default value). + + sched/ + db_purge.C + handle_request.C + +. diff --git a/sched/db_purge.C b/sched/db_purge.C index 5eaac2bea5..a1d1e84ad6 100644 --- a/sched/db_purge.C +++ b/sched/db_purge.C @@ -53,6 +53,9 @@ // being closed. In any case the files are compressed // when db_purge exits on a signal. +// -sleep N // when done with a pass of purging the DB, sleep + // for N seconds before the next pass. Default + // value is 600 seconds. #include "config.h" #include @@ -557,7 +560,7 @@ int main(int argc, char** argv) { int retval; bool asynch = false, one_pass = false; int i; - + int sleep_sec = 600; check_stop_daemons(); for (i=1; i 86400) { + log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL, + "Unreasonable value of sleep interval: %d seconds\n", + sleep_sec + ); + exit(1); + } } else { log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL, "Unrecognized arg: %s\n", argv[i] @@ -626,7 +638,7 @@ int main(int argc, char** argv) { log_messages.printf(SCHED_MSG_LOG::MSG_NORMAL, "Sleeping....\n" ); - sleep(600); + sleep(sleep_sec); } } diff --git a/sched/handle_request.C b/sched/handle_request.C index 3d4459c9b9..28b2bbc6a4 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -624,22 +624,22 @@ int handle_results(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { switch (srip->outcome) { case RESULT_OUTCOME_INIT: // should never happen! - dont_replace_result = "server shows no record of having sent this work"; + dont_replace_result = "this work was NEVER sent"; break; case RESULT_OUTCOME_SUCCESS: // don't replace a successful result! - dont_replace_result = "successful result already reported for this result"; + dont_replace_result = "successful result ALREADY reported for this work"; break; case RESULT_OUTCOME_COULDNT_SEND: // should never happen! - dont_replace_result = "server records show that this work was not sent (couldn't send)"; + dont_replace_result = "this work could NOT be sent"; break; case RESULT_OUTCOME_CLIENT_ERROR: // result was previously cancelled on server side. // keep this new, real result ONLY if validator has // not already been invoked. if (srip->validate_state != VALIDATE_STATE_INIT) { - dont_replace_result = "previous result reported as error, or canceled on server"; + dont_replace_result = "result ALREADY reported as error, or canceled on server"; } break; case RESULT_OUTCOME_NO_REPLY: @@ -647,12 +647,12 @@ int handle_results(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { break; case RESULT_OUTCOME_DIDNT_NEED: // should never happen - dont_replace_result = "server records show that this work was not sent (not needed)"; + dont_replace_result = "this work was NEVER sent (not needed)"; break; case RESULT_OUTCOME_VALIDATE_ERROR: // we already passed through the validator, so // don't keep the new result - dont_replace_result = "server records show that an invalid result was already returned"; + dont_replace_result = "an invalid result was ALREADY returned"; break; default: dont_replace_result = "server logic bug; please alert BOINC developers"; @@ -662,8 +662,8 @@ int handle_results(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { char buf[256]; log_messages.printf( SCHED_MSG_LOG::MSG_CRITICAL, - "[HOST#%d] [RESULT#%d %s] result already over [outcome=%d validate_state=%d]\n", - reply.host.id, srip->id, srip->name, srip->outcome, srip->validate_state + "[HOST#%d] [RESULT#%d %s] result already over [outcome=%d validate_state=%d]: %s\n", + reply.host.id, srip->id, srip->name, srip->outcome, srip->validate_state, dont_replace_result ); sprintf(buf, "Completed result %s refused: %s", srip->name, dont_replace_result); USER_MESSAGE um(buf, "high");