mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=6281
This commit is contained in:
parent
f35a0a67bd
commit
197db0a3c5
|
@ -7335,3 +7335,17 @@ David 1 June 2005
|
|||
|
||||
sched/
|
||||
handle_request.C
|
||||
|
||||
David 2 June 2005
|
||||
- add a new value FILE_DELETE_ERROR for file delete state
|
||||
(for when the unlink failed, e.g. because of permissions).
|
||||
- add a new cmdline flag -retry_errors to file deleter
|
||||
|
||||
(from Kevin Reed)
|
||||
|
||||
db/
|
||||
boinc_db.h
|
||||
html/inc/
|
||||
db_ops.inc
|
||||
sched/
|
||||
file_deleter.C
|
||||
|
|
|
@ -266,8 +266,9 @@ struct HOST {
|
|||
#define FILE_DELETE_READY 1
|
||||
// set to this value only when we believe all files are uploaded
|
||||
#define FILE_DELETE_DONE 2
|
||||
// means the file uploader ATTEMPTED to delete files.
|
||||
// May have failed. TODO: retry delete later
|
||||
// means the files were successfully deleted
|
||||
#define FILE_DELETE_ERROR 3
|
||||
// Any error was returned while attempting to delete the file
|
||||
|
||||
// values for assimilate_state
|
||||
#define ASSIMILATE_INIT 0
|
||||
|
|
|
@ -472,7 +472,7 @@ function show_result_summary() {
|
|||
for ($cs=1; $cs<6; $cs++) {
|
||||
$client_state[$cs] = 0;
|
||||
}
|
||||
for ($fds=0; $fds<3; $fds++) {
|
||||
for ($fds=0; $fds<4; $fds++) {
|
||||
$delete_state[$fds] = 0;
|
||||
}
|
||||
for ($vs=0; $vs<NVALIDATE_STATES; $vs++) {
|
||||
|
@ -524,6 +524,7 @@ SELECT COUNT(id) AS nTotal,
|
|||
SUM(case when server_state = '5' and outcome = '1' and file_delete_state = '0' then 1 else 0 end) AS filedeletestate_init,
|
||||
SUM(case when server_state = '5' and outcome = '1' and file_delete_state = '1' then 1 else 0 end) AS filedeletestate_ready,
|
||||
SUM(case when server_state = '5' and outcome = '1' and file_delete_state = '2' then 1 else 0 end) AS filedeletestate_done,
|
||||
SUM(case when server_state = '5' and outcome = '1' and file_delete_state = '3' then 1 else 0 end) AS filedeletestate_error,
|
||||
SUM(case when server_state = '5' and outcome = '3' and client_state = '0' then 1 else 0 end) AS clientstate_init,
|
||||
SUM(case when server_state = '5' and outcome = '3' and client_state = '1' then 1 else 0 end) AS clientstate_downloading,
|
||||
SUM(case when server_state = '5' and outcome = '3' and client_state = '2' then 1 else 0 end) AS clientstate_downloaded,
|
||||
|
@ -585,8 +586,9 @@ FROM result WHERE
|
|||
$file_delete[0] = $res->filedeletestate_init;
|
||||
$file_delete[1] = $res->filedeletestate_ready;
|
||||
$file_delete[2] = $res->filedeletestate_done;
|
||||
$file_delete[3] = $res->filedeletestate_error;
|
||||
|
||||
$nfile_deleted = $res->filedeletestate_ready + $res->filedeletestate_done;
|
||||
$nfile_deleted = $res->filedeletestate_ready + $res->filedeletestate_done + $res->filedeletestate_error;
|
||||
mysql_free_result($result);
|
||||
}
|
||||
|
||||
|
@ -627,12 +629,12 @@ FROM result WHERE
|
|||
echo "<table border=\"2\" cellpadding=\"4\"\n";
|
||||
echo "<tr><th>File Delete state</th><th># results</th></tr>\n";
|
||||
|
||||
for ($fds=0; $fds<3; $fds++) {
|
||||
for ($fds=0; $fds<4; $fds++) {
|
||||
row2(file_delete_state_str($fds),
|
||||
link_results("$file_delete[$fds]", $urlquery, "outcome=1", "file_delete_state=$fds"));
|
||||
}
|
||||
row2("Total files deleted",
|
||||
link_results("$nfile_deleted", $urlquery, "outcome=1", "(file_delete_state=1 or file_delete_state=2)"));
|
||||
link_results("$nfile_deleted", $urlquery, "outcome=1", "(file_delete_state=1 or file_delete_state=2 or file_delete_state=3)"));
|
||||
echo "</table></td>";
|
||||
|
||||
echo "<td><table border=\"2\" cellpadding=\"4\"\n";
|
||||
|
@ -924,6 +926,7 @@ function file_delete_state_str($s) {
|
|||
case 0: return "Initial";
|
||||
case 1: return "Ready to delete";
|
||||
case 2: return "Deleted";
|
||||
case 3: return "Delete Error";
|
||||
}
|
||||
echo "<b>THIS IS AN INTERNAL BUG IN BOINC: PLEASE CONTACT BOINC DEVELOPERS</b><br/>";
|
||||
return "Unknown";
|
||||
|
|
|
@ -178,16 +178,20 @@ static bool preserve_result_files=false;
|
|||
|
||||
// return nonzero if did anything
|
||||
//
|
||||
bool do_pass() {
|
||||
bool do_pass(bool retry_error) {
|
||||
DB_WORKUNIT wu;
|
||||
DB_RESULT result;
|
||||
bool did_something = false, got_error = false;
|
||||
bool did_something = false;
|
||||
char buf[256];
|
||||
int retval;
|
||||
|
||||
check_stop_daemons();
|
||||
|
||||
sprintf(buf, "where file_delete_state=%d limit 1000", FILE_DELETE_READY);
|
||||
if (retry_error) {
|
||||
sprintf(buf, "where file_delete_state=%d or file_delete_state=%d limit 1000", FILE_DELETE_READY, FILE_DELETE_ERROR);
|
||||
} else {
|
||||
sprintf(buf, "where file_delete_state=%d limit 1000", FILE_DELETE_READY);
|
||||
}
|
||||
while (!wu.enumerate(buf)) {
|
||||
did_something = true;
|
||||
|
||||
|
@ -196,20 +200,20 @@ bool do_pass() {
|
|||
retval = wu_delete_files(wu);
|
||||
}
|
||||
if (retval) {
|
||||
got_error = true;
|
||||
wu.file_delete_state = FILE_DELETE_ERROR;
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "[WU#%d] update failed: %d\n", wu.id, retval);
|
||||
} else {
|
||||
wu.file_delete_state = FILE_DELETE_DONE;
|
||||
sprintf(buf, "file_delete_state=%d", wu.file_delete_state);
|
||||
retval= wu.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
|
||||
"[WU#%d] update failed: %d\n", wu.id, retval
|
||||
);
|
||||
}
|
||||
}
|
||||
sprintf(buf, "file_delete_state=%d", wu.file_delete_state);
|
||||
retval= wu.update_field(buf);
|
||||
}
|
||||
|
||||
sprintf(buf, "where file_delete_state=%d limit 1000", FILE_DELETE_READY);
|
||||
if ( retry_error ) {
|
||||
sprintf(buf, "where file_delete_state=%d or file_delete_state=%d limit 1000", FILE_DELETE_READY, FILE_DELETE_ERROR);
|
||||
} else {
|
||||
sprintf(buf, "where file_delete_state=%d limit 1000", FILE_DELETE_READY);
|
||||
}
|
||||
while (!result.enumerate(buf)) {
|
||||
did_something = true;
|
||||
retval = 0;
|
||||
|
@ -217,27 +221,20 @@ bool do_pass() {
|
|||
retval = result_delete_files(result);
|
||||
}
|
||||
if (retval) {
|
||||
got_error = true;
|
||||
result.file_delete_state = FILE_DELETE_ERROR;
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "[RESULT#%d] update failed: %d\n", result.id, retval);
|
||||
} else {
|
||||
result.file_delete_state = FILE_DELETE_DONE;
|
||||
sprintf(buf, "file_delete_state=%d", result.file_delete_state);
|
||||
retval= result.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
|
||||
"[RESULT#%d] update failed: %d\n", result.id, retval
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (got_error) {
|
||||
sleep(SLEEP_INTERVAL);
|
||||
sprintf(buf, "file_delete_state=%d", result.file_delete_state);
|
||||
retval= result.update_field(buf);
|
||||
}
|
||||
return did_something;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int retval;
|
||||
bool asynch = false, one_pass = false;
|
||||
bool asynch = false, one_pass = false, retry_error = false;
|
||||
int i;
|
||||
|
||||
check_stop_daemons();
|
||||
|
@ -246,6 +243,8 @@ int main(int argc, char** argv) {
|
|||
asynch = true;
|
||||
} else if (!strcmp(argv[i], "-one_pass")) {
|
||||
one_pass = true;
|
||||
} else if (!strcmp(argv[i], "-retry_error")) {
|
||||
retry_error=true;
|
||||
} else if (!strcmp(argv[i], "-preserve_wu_files")) {
|
||||
// This option is primarily for testing.
|
||||
// If enabled, the file_deleter will function 'normally'
|
||||
|
@ -298,10 +297,10 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
install_stop_signal_handler();
|
||||
if (one_pass) {
|
||||
do_pass();
|
||||
do_pass(retry_error);
|
||||
} else {
|
||||
while (1) {
|
||||
if (!do_pass()) sleep(SLEEP_INTERVAL);
|
||||
if (!do_pass(retry_error)) sleep(SLEEP_INTERVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue