Skip to content

Commit

Permalink
Scheduler: refuse to upload results if DB item is
Browse files Browse the repository at this point in the history
(1) over and (2) validate state init and (3) NOT file_delete==INIT.

(David, please bless addition of file_delete_state to SCHED_RESULT_ITEM.)

svn path=/trunk/boinc/; revision=10245
  • Loading branch information
ballen4705 committed Jun 3, 2006
1 parent 39e4ffc commit 033c671
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -5423,10 +5423,15 @@ David 2 June 2006
Bruce 3 June 2006
- Transitioner: nasty bug in logging, wrong result id/name
- Scheduler: clearer logging for debugging purposes
- Scheduler: refuse to upload results if DB item is
(1) over and (2) validate state init and (3) NOT file_delete==INIT.

(David, please bless addition of file_delete_state to SCHED_RESULT_ITEM.)

db/
boinc_db.C
boinc_db.h
sched/
handle_request.C
transitioner.C

4 changes: 3 additions & 1 deletion db/boinc_db.C
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,7 @@ void SCHED_RESULT_ITEM::parse(MYSQL_ROW& r) {
validate_state = atoi(r[i++]);
outcome = atoi(r[i++]);
client_state = atoi(r[i++]);
file_delete_state = atoi(r[i++]);
}

int DB_SCHED_RESULT_ITEM_SET::add_result(char* result_name) {
Expand Down Expand Up @@ -1340,7 +1341,8 @@ int DB_SCHED_RESULT_ITEM_SET::enumerate() {
" received_time, "
" validate_state, "
" outcome, "
" client_state "
" client_state, "
" file_delete_state "
"FROM "
" result "
"WHERE "
Expand Down
1 change: 1 addition & 0 deletions db/boinc_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ struct SCHED_RESULT_ITEM {
char stderr_out[LARGE_BLOB_SIZE];
int app_version_num;
int exit_status;
int file_delete_state;

void clear();
void parse(MYSQL_ROW& row);
Expand Down
6 changes: 4 additions & 2 deletions sched/handle_request.C
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ int handle_results(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
}

log_messages.printf(
SCHED_MSG_LOG::MSG_NORMAL, "[HOST#%d] [RESULT#%d %s] got result (DB: server_state=%d outcome=%d client_state=%d validate_state=%d)\n",
reply.host.id, srip->id, srip->name, srip->server_state, srip->outcome, srip->client_state, srip->validate_state
SCHED_MSG_LOG::MSG_NORMAL, "[HOST#%d] [RESULT#%d %s] got result (DB: server_state=%d outcome=%d client_state=%d validate_state=%d delete_state=%d)\n",
reply.host.id, srip->id, srip->name, srip->server_state, srip->outcome, srip->client_state, srip->validate_state, srip->file_delete_state
);

// Do various sanity checks.
Expand Down Expand Up @@ -640,6 +640,8 @@ int handle_results(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
// not already been invoked.
if (srip->validate_state != VALIDATE_STATE_INIT) {
dont_replace_result = "result ALREADY reported as error, or canceled on server";
} else if (srip->file_delete_state != FILE_DELETE_INIT) {
dont_replace_result = "result ALREADY reported as error or canceled on server, and deleted";
}
break;
case RESULT_OUTCOME_NO_REPLY:
Expand Down

0 comments on commit 033c671

Please sign in to comment.