- client: it a file upload fails for a job that's in progress,

abort the task.  Otherwise we end up reporting the job
    while the app is still running.

svn path=/trunk/boinc/; revision=16128
This commit is contained in:
David Anderson 2008-10-04 16:00:28 +00:00
parent 932eabba94
commit 0cf82b2746
3 changed files with 29 additions and 6 deletions

View File

@ -8025,3 +8025,12 @@ Charlie 3 Oct 2008
clientgui/ clientgui/
BOINCListCtrl.cpp BOINCListCtrl.cpp
David 4 Oct 2008
- client: it a file upload fails for a job that's in progress,
abort the task. Otherwise we end up reporting the job
while the app is still running.
client/
client_state.cpp
cs_trickle.cpp

View File

@ -1000,8 +1000,10 @@ bool CLIENT_STATE::garbage_collect_always() {
"garbage_collect(); still have active task for acked result %s; state %d", "garbage_collect(); still have active task for acked result %s; state %d",
rp->name, atp->task_state() rp->name, atp->task_state()
); );
atp->set_task_state(PROCESS_EXITED, "garbage_collect"); atp->abort_task(
// this will get rid of it EXIT_ABORTED_BY_CLIENT,
"Got ack for job that's till active"
);
} else { } else {
if (log_flags.state_debug) { if (log_flags.state_debug) {
msg_printf(0, MSG_INFO, msg_printf(0, MSG_INFO,
@ -1038,8 +1040,6 @@ bool CLIENT_STATE::garbage_collect_always() {
for (i=0; i<rp->output_files.size(); i++) { for (i=0; i<rp->output_files.size(); i++) {
// If one of the output files had an upload failure, // If one of the output files had an upload failure,
// mark the result as done and report the error. // mark the result as done and report the error.
// The result, workunits, and file infos
// will be cleaned up after the server is notified
// //
if (!rp->ready_to_report) { if (!rp->ready_to_report) {
fip = rp->output_files[i].file_info; fip = rp->output_files[i].file_info;
@ -1053,6 +1053,20 @@ bool CLIENT_STATE::garbage_collect_always() {
rp->output_files[i].file_info->ref_cnt++; rp->output_files[i].file_info->ref_cnt++;
} }
if (found_error) { if (found_error) {
// check for process still running; this can happen
// e.g. if an intermediate upload fails
//
ACTIVE_TASK* atp = active_tasks.lookup_result(rp);
if (atp) {
switch (atp->task_state()) {
case PROCESS_EXECUTING:
case PROCESS_SUSPENDED:
atp->abort_task(
EXIT_ABORTED_BY_CLIENT,
"Got ack for job that's till active"
);
}
}
report_result_error(*rp, "%s", error_str.c_str()); report_result_error(*rp, "%s", error_str.c_str());
} }
rp->avp->ref_cnt++; rp->avp->ref_cnt++;

View File

@ -86,8 +86,8 @@ int CLIENT_STATE::read_trickle_files(PROJECT* project, FILE* f) {
return 0; return 0;
} }
// Remove files when ack has been received // Remove files when ack has been received.
// remove only this ending with ".sent" // Remove only those ending with ".sent"
// (others arrived from application while RPC was happening) // (others arrived from application while RPC was happening)
// //
int CLIENT_STATE::remove_trickle_files(PROJECT* project) { int CLIENT_STATE::remove_trickle_files(PROJECT* project) {