mirror of https://github.com/BOINC/boinc.git
- client: print log msgs (enabled by task_debug) if the client
times out on quitting or aborting a task, and has to kill it. - volunteer storage: bug fixes svn path=/trunk/boinc/; revision=26050
This commit is contained in:
parent
eb40422c34
commit
52068b5f2d
|
@ -5621,3 +5621,14 @@ Charlie 20 Aug 2012
|
|||
gpu_amd.cpp
|
||||
lib/
|
||||
coproc.h
|
||||
|
||||
David 20 Aug 2012
|
||||
- client: print log msgs (enabled by task_debug) if the client
|
||||
times out on quitting or aborting a task, and has to kill it.
|
||||
- volunteer storage: bug fixes
|
||||
|
||||
vda/
|
||||
sched_vda.cpp
|
||||
vda_lib2.cpp
|
||||
client/
|
||||
app_control.cpp
|
||||
|
|
|
@ -98,11 +98,23 @@ bool ACTIVE_TASK_SET::poll() {
|
|||
ACTIVE_TASK* atp = active_tasks[i];
|
||||
if (atp->task_state() == PROCESS_ABORT_PENDING) {
|
||||
if (gstate.now > atp->abort_time + ABORT_TIMEOUT) {
|
||||
if (log_flags.task_debug) {
|
||||
msg_printf(atp->result->project, MSG_INFO,
|
||||
"[task] abort request timed out, killing task %s",
|
||||
atp->result->name
|
||||
);
|
||||
}
|
||||
atp->kill_task(false);
|
||||
}
|
||||
}
|
||||
if (atp->task_state() == PROCESS_QUIT_PENDING) {
|
||||
if (gstate.now > atp->quit_time + QUIT_TIMEOUT) {
|
||||
if (log_flags.task_debug) {
|
||||
msg_printf(atp->result->project, MSG_INFO,
|
||||
"[task] quit request timed out, killing task %s",
|
||||
atp->result->name
|
||||
);
|
||||
}
|
||||
atp->kill_task(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ static int process_completed_upload(char* phys_filename, CHUNK_LIST& chunks) {
|
|||
// - mark vda_file for update
|
||||
//
|
||||
static void process_chunk_present_on_client(FILE_INFO& fi, CHUNK_LIST& chunks) {
|
||||
char fname[256], chunk_name[256], buf[256];
|
||||
char fname[256], chunk_name[256], buf[1024];
|
||||
int hostid, retval;
|
||||
retval = parse_physical_filename(fi.name, hostid, chunk_name, fname);
|
||||
if (retval) {
|
||||
|
@ -243,15 +243,21 @@ static void process_chunk_present_on_client(FILE_INFO& fi, CHUNK_LIST& chunks) {
|
|||
sprintf(buf, "where file_name='%s'", fname);
|
||||
retval = vf.lookup(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(MSG_CRITICAL, "No VDA file %s\n", fname);
|
||||
log_messages.printf(MSG_CRITICAL,
|
||||
"No VDA file for %s, deleting\n", fi.name
|
||||
);
|
||||
delete_file_xml(fi.name, buf);
|
||||
g_reply->file_transfer_requests.push_back(string(buf));
|
||||
return;
|
||||
}
|
||||
|
||||
if (fi.nbytes != vf.chunk_size) {
|
||||
log_messages.printf(MSG_CRITICAL,
|
||||
"wrong chunk size: %.0f != %.0f\n",
|
||||
fi.nbytes, vf.chunk_size
|
||||
"wrong chunk size for %s: %.0f != %.0f, deleting\n",
|
||||
fi.name, fi.nbytes, vf.chunk_size
|
||||
);
|
||||
delete_file_xml(fi.name, buf);
|
||||
g_reply->file_transfer_requests.push_back(string(buf));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -368,12 +374,24 @@ static int enforce_quota(CHUNK_LIST& chunks) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// does the host already have a result of the given name?
|
||||
//
|
||||
static bool result_already_on_host(const char* name) {
|
||||
for (unsigned int i=0; i<g_request->other_results.size(); i++) {
|
||||
OTHER_RESULT& r = g_request->other_results[i];
|
||||
if (!strcmp(r.name, name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// issue upload and download commands
|
||||
//
|
||||
static int issue_transfer_commands(CHUNK_LIST& chunks) {
|
||||
char xml_buf[8192], chunk_name[256], file_name[1024];
|
||||
int retval;
|
||||
char url[1024];
|
||||
char url[1024], buf[1024];
|
||||
|
||||
CHUNK_LIST::iterator it;
|
||||
for (it = chunks.begin(); it != chunks.end(); it++) {
|
||||
|
@ -387,6 +405,16 @@ static int issue_transfer_commands(CHUNK_LIST& chunks) {
|
|||
if (ch.present_on_host) {
|
||||
// upload
|
||||
//
|
||||
sprintf(buf, "upload_%s", ch.physical_file_name);
|
||||
if (result_already_on_host(buf)) {
|
||||
if (config.debug_vda) {
|
||||
log_messages.printf(MSG_NORMAL,
|
||||
"[vda] upload of %s already in progress\n",
|
||||
ch.physical_file_name
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (config.debug_vda) {
|
||||
log_messages.printf(MSG_NORMAL,
|
||||
"[vda] sending command to upload %s\n",
|
||||
|
@ -407,6 +435,16 @@ static int issue_transfer_commands(CHUNK_LIST& chunks) {
|
|||
} else {
|
||||
// download
|
||||
//
|
||||
sprintf(buf, "download_%s", ch.physical_file_name);
|
||||
if (result_already_on_host(buf)) {
|
||||
if (config.debug_vda) {
|
||||
log_messages.printf(MSG_NORMAL,
|
||||
"[vda] download of %s already in progress\n",
|
||||
ch.physical_file_name
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
char md5[64], chunk_dir[1024];
|
||||
int hostid;
|
||||
if (config.debug_vda) {
|
||||
|
|
|
@ -308,7 +308,12 @@ int META_CHUNK::decode() {
|
|||
//
|
||||
char linkpath[1024], filepath[1024];
|
||||
sprintf(linkpath, "%s/data.vda", dir);
|
||||
readlink(linkpath, filepath, sizeof(filepath));
|
||||
ssize_t n = readlink(linkpath, filepath, sizeof(filepath));
|
||||
if (n < 0) {
|
||||
perror("readlink");
|
||||
return -1;
|
||||
}
|
||||
filepath[n] = 0;
|
||||
sprintf(cmd, "mv %s/Coding/data_decoded.vda %s", dir, filepath);
|
||||
system(cmd);
|
||||
return 0;
|
||||
|
@ -318,6 +323,7 @@ int META_CHUNK::decode() {
|
|||
//
|
||||
int META_CHUNK::reconstruct() {
|
||||
unsigned int i;
|
||||
int retval;
|
||||
|
||||
// reconstruct enough children that we can reconstruct ourself
|
||||
//
|
||||
|
@ -326,13 +332,15 @@ int META_CHUNK::reconstruct() {
|
|||
for (i=0; i<children.size(); i++) {
|
||||
META_CHUNK* cp = (META_CHUNK*)children[i];
|
||||
if (cp->status == PRESENT) {
|
||||
cp->reconstruct();
|
||||
retval = cp->reconstruct();
|
||||
if (retval) return retval;
|
||||
n++;
|
||||
if (n == coding.n) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
decode();
|
||||
retval = decode();
|
||||
if (retval) return retval;
|
||||
|
||||
// then delete childrens' files
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue