From 0cf82b2746fc745376268aa9111c8b6722db1ed8 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 4 Oct 2008 16:00:28 +0000 Subject: [PATCH] - 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 --- checkin_notes | 9 +++++++++ client/client_state.cpp | 22 ++++++++++++++++++---- client/cs_trickle.cpp | 4 ++-- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index 8f4961f27b..312d4cb2ad 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8025,3 +8025,12 @@ Charlie 3 Oct 2008 clientgui/ 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 diff --git a/client/client_state.cpp b/client/client_state.cpp index e2c7bc4404..fa8ecda342 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -1000,8 +1000,10 @@ bool CLIENT_STATE::garbage_collect_always() { "garbage_collect(); still have active task for acked result %s; state %d", rp->name, atp->task_state() ); - atp->set_task_state(PROCESS_EXITED, "garbage_collect"); - // this will get rid of it + atp->abort_task( + EXIT_ABORTED_BY_CLIENT, + "Got ack for job that's till active" + ); } else { if (log_flags.state_debug) { msg_printf(0, MSG_INFO, @@ -1038,8 +1040,6 @@ bool CLIENT_STATE::garbage_collect_always() { for (i=0; ioutput_files.size(); i++) { // If one of the output files had an upload failure, // 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) { 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++; } 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()); } rp->avp->ref_cnt++; diff --git a/client/cs_trickle.cpp b/client/cs_trickle.cpp index d203df8200..bb44c63dac 100644 --- a/client/cs_trickle.cpp +++ b/client/cs_trickle.cpp @@ -86,8 +86,8 @@ int CLIENT_STATE::read_trickle_files(PROJECT* project, FILE* f) { return 0; } -// Remove files when ack has been received -// remove only this ending with ".sent" +// Remove files when ack has been received. +// Remove only those ending with ".sent" // (others arrived from application while RPC was happening) // int CLIENT_STATE::remove_trickle_files(PROJECT* project) {