Skip to content

Commit

Permalink
Merge pull request BOINC#3293 from BOINC/dpa_missing_file
Browse files Browse the repository at this point in the history
if output file missing, mark task as error
  • Loading branch information
TheAspens authored and davidpanderson committed Sep 28, 2019
1 parent 26a2c91 commit 4b1ff73
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
3 changes: 3 additions & 0 deletions client/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ void ACTIVE_TASK::cleanup_task() {
kill_subsidiary_processes();

if (cc_config.exit_after_finish) {
msg_printf(wup->project, MSG_INFO,
"exit_after_finish: job %s, slot %d", wup->name, slot
);
gstate.write_state_file();
exit(0);
}
Expand Down
5 changes: 3 additions & 2 deletions client/check_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ void CLIENT_STATE::check_app(APP& p) {
}

void CLIENT_STATE::check_file_info(FILE_INFO& p) {
if (p.pers_file_xfer) check_pers_file_xfer_pointer(p.pers_file_xfer);
if (p.result) check_result_pointer(p.result);
if (p.pers_file_xfer) {
check_pers_file_xfer_pointer(p.pers_file_xfer);
}
check_project_pointer(p.project);
}

Expand Down
1 change: 1 addition & 0 deletions client/client_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ struct CLIENT_STATE {

// --------------- cs_files.cpp:
void check_file_existence();
RESULT* file_info_to_result(FILE_INFO*);
bool start_new_file_xfer(PERS_FILE_XFER&);

int make_project_dirs();
Expand Down
1 change: 0 additions & 1 deletion client/client_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ FILE_INFO::FILE_INFO() {
is_auto_update_file = false;
anonymous_platform_file = false;
pers_file_xfer = NULL;
result = NULL;
project = NULL;
download_urls.clear();
upload_urls.clear();
Expand Down
2 changes: 0 additions & 2 deletions client/client_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ struct FILE_INFO {
// for output files: gzip file when done, and append .gz to its name
class PERS_FILE_XFER* pers_file_xfer;
// nonzero if in the process of being up/downloaded
RESULT* result;
// for upload files (to authenticate)
PROJECT* project;
int ref_cnt;
URL_LIST download_urls;
Expand Down
28 changes: 28 additions & 0 deletions client/cs_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "client_msgs.h"
#include "file_xfer.h"
#include "project.h"
#include "result.h"
#include "sandbox.h"

using std::vector;
Expand Down Expand Up @@ -507,6 +508,33 @@ void CLIENT_STATE::check_file_existence() {
);
}
}
// If an output file disappears before it's uploaded,
// flag the job as an error.
//
if (fip->status == FILE_NOT_PRESENT && fip->uploadable() && !fip->uploaded) {
RESULT* rp = file_info_to_result(fip);
if (rp) {
gstate.report_result_error(
*rp, "output file missing or invalid"
);
}
}
}
}

// return the result that *fip is an output file of, if any
//
RESULT* CLIENT_STATE::file_info_to_result(FILE_INFO* fip) {
unsigned int i, j;
for (i=0; i<results.size(); i++) {
RESULT* rp = results[i];
if (rp->project != fip->project) continue;
for (j=0; j<rp->output_files.size(); j++) {
FILE_REF& fr = rp->output_files[j];
if (fr.file_info == fip) {
return rp;
}
}
}
return NULL;
}

0 comments on commit 4b1ff73

Please sign in to comment.