mirror of https://github.com/BOINC/boinc.git
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
This commit is contained in:
parent
a3b416e9dc
commit
3f8792bf2a
|
@ -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
|
||||
|
||||
.
|
||||
|
|
|
@ -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 <cstdio>
|
||||
|
@ -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<argc; i++) {
|
||||
if (!strcmp(argv[i], "-asynch")) {
|
||||
|
@ -576,6 +579,15 @@ int main(int argc, char** argv) {
|
|||
compression_type=COMPRESSION_GZIP;
|
||||
} else if (!strcmp(argv[i], "-max_wu_per_file")) {
|
||||
max_wu_per_file = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "-sleep")) {
|
||||
sleep_sec = atoi(argv[++i]);
|
||||
if (sleep_sec < 1 || sleep_sec > 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue