diff --git a/checkin_notes b/checkin_notes index 2fde2ab317..7d9a47b510 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7464,3 +7464,25 @@ David 4 Nov 2003 win_build/ boinc_cli.dsp boinc_gui.dsp + +David 5 Nov 2003 + - The following changes fix core client crashes that occur when + reset a project, then quickly detach from the project + while downloads are occurring. + In once instance, this produced a state file that caused + the client to crash each time it started up. + - when parse an ACTIVE_TASK in state file, + verify that the corresponding result is in the right state + (RESULT_FILES_DOWNLOADED, with got_server_ack and ready_to_report false) + - when parse a RESULT in state file, + make sure it's consistent: in particular, if got_server_ack or ready_to_report + is true, the state must be RESULT_FILES_UPLOADED + - CLIENT_STATE::detach_project(): delete all the project's FILE_INFOs + (reset_project() doesn't do this) + + client/ + app.C + client_state.C + client_types.C + lib/ + error_numbers.h diff --git a/client/app.C b/client/app.C index d517e6740f..5afbdc9ab4 100644 --- a/client/app.C +++ b/client/app.C @@ -1288,20 +1288,33 @@ int ACTIVE_TASK::parse(FILE* fin, CLIENT_STATE* cs) { result = cs->lookup_result(project, result_name); if (!result) { msg_printf( - NULL, MSG_ERROR, "ACTIVE_TASK::parse(): result not found\n" + project, MSG_ERROR, "ACTIVE_TASK::parse(): result not found\n" ); return ERR_NULL; } + + // various sanity checks + // + if (result->got_server_ack + || result->ready_to_report + || result->state != RESULT_FILES_DOWNLOADED + ) { + msg_printf(project, MSG_ERROR, + "ACTIVE_TASK::parse(): result is in wrong state\n" + ); + return ERR_BAD_RESULT_STATE; + } + wup = result->wup; app_version = cs->lookup_app_version( result->app, app_version_num ); if (!app_version) { msg_printf( - NULL, MSG_ERROR, + project, MSG_ERROR, "ACTIVE_TASK::parse(): app_version not found\n" ); - return -1; + return ERR_NULL; } return 0; } diff --git a/client/client_state.C b/client/client_state.C index 4929bfd0d0..b6873aeaca 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -956,7 +956,8 @@ int CLIENT_STATE::report_result_error( // - delete all apps and app_versions // - garbage collect to delete unneeded files // -// Note: does NOT delete persistent files or delete project dir +// Note: does NOT delete persistent files or user-supplied files; +// does not delete project dir // int CLIENT_STATE::reset_project(PROJECT* project) { unsigned int i; @@ -989,6 +990,10 @@ int CLIENT_STATE::reset_project(PROJECT* project) { http_ops->remove(&scheduler_op->http_op); } + // mark results as server-acked. + // This will cause garbage_collect to delete them, + // and in turn their WUs will be deleted + // for (i=0; iproject == project) { @@ -1028,7 +1033,9 @@ int CLIENT_STATE::reset_project(PROJECT* project) { // - delete account directory // int CLIENT_STATE::detach_project(PROJECT* project) { - vector::iterator iter; + vector::iterator project_iter; + vector::iterator fi_iter; + FILE_INFO* fip; PROJECT* p; char path[256]; int retval; @@ -1037,12 +1044,24 @@ int CLIENT_STATE::detach_project(PROJECT* project) { msg_printf(project, MSG_INFO, "Detaching from project"); + // delete all FILE_INFOs associated with this project + // + fi_iter = file_infos.begin(); + while (fi_iter != file_infos.end()) { + fip = *fi_iter; + if (fip->project == project) { + file_infos.erase(fi_iter); + } else { + fi_iter++; + } + } + // find project and remove it from the vector // - for (iter = projects.begin(); iter != projects.end(); iter++) { - p = *iter; + for (project_iter = projects.begin(); project_iter != projects.end(); project_iter++) { + p = *project_iter; if (p == project) { - projects.erase(iter); + projects.erase(project_iter); break; } } diff --git a/client/client_types.C b/client/client_types.C index 410c258742..b6f7d47776 100644 --- a/client/client_types.C +++ b/client/client_types.C @@ -879,7 +879,14 @@ int RESULT::parse_state(FILE* in) { clear(); while (fgets(buf, 256, in)) { - if (match_tag(buf, "")) return 0; + if (match_tag(buf, "")) { + // restore some invariants in case of bad state file + // + if (got_server_ack || ready_to_report) { + state = RESULT_FILES_UPLOADED; + } + return 0; + } if (parse_str(buf, "", name, sizeof(name))) continue; if (parse_str(buf, "", wu_name, sizeof(wu_name))) continue; if (parse_int(buf, "", report_deadline)) continue; diff --git a/client/prefs.C b/client/prefs.C index eed7aaec67..43664b66d0 100644 --- a/client/prefs.C +++ b/client/prefs.C @@ -173,12 +173,12 @@ int GLOBAL_PREFS::parse(FILE* in, char* host_venue) { } if (strlen(host_venue)) { if (found_venue) { - msg_printf(NULL, MSG_INFO, "Using general preferences for '%s'\n", host_venue); + msg_printf(NULL, MSG_INFO, "Using your general preferences for '%s'\n", host_venue); } else { - msg_printf(NULL, MSG_INFO, "No general preferences for '%s'; using default preferences\n", host_venue); + msg_printf(NULL, MSG_INFO, "No general preferences for '%s'; using your default preferences\n", host_venue); } } else { - msg_printf(NULL, MSG_INFO, "Using default general preferences\n"); + msg_printf(NULL, MSG_INFO, "Using your default general preferences\n"); } return 0; } diff --git a/doc/index.html b/doc/index.html index 6599f12baf..f7ccd4e10b 100644 --- a/doc/index.html +++ b/doc/index.html @@ -85,6 +85,14 @@ Several other distributed computing projects are evaluating BOINC.

News

+November 5, 2003 +
+The graphics of running application are updated whenever +preferences are changed. +The scheduler now issues only as many results as will fit in +the allotted amount of disk space. + +

October 30, 2003
New minor versions of the core client and beta-test apps have been released. @@ -103,36 +111,6 @@ Don't send two results from the same workunit to a single user. Added JPEG support to application graphics. Added "confirm before accept executable" mechanism. -

-September 11, 2003 -
-BOINC is discussed in - -an article by Joan Oleck in the New York TImes. -

- -September 4, 2003 -
-We've released BOINC version 2.0. -All BOINC components must be upgraded to major version 2. -We've upgraded the Astropulse server to 2.01 and -released BOINC core -client 2.01. -This was due to an architecture and protocol change in -specifying resource estimates and limits. -

-September 1, 2003 -
-BOINC server tools are now Python-based. A database -back-end API allows quick development of data-manipulation utilities. -

-August 15, 2003 -
-We rewrote parts of the scheduling server architecture to make operations -more flexible and efficient. -The timeout_check -daemon has been replaced by a more general transitioner daemon.

Archived news diff --git a/doc/old_news.php b/doc/old_news.php index cb7f43b2f8..474e9cb930 100644 --- a/doc/old_news.php +++ b/doc/old_news.php @@ -3,6 +3,36 @@ require_once("docutil.php"); page_head("Archived news"); echo "

+September 11, 2003 +
+BOINC is discussed in + +an article by Joan Oleck in the New York TImes. +

+ +September 4, 2003 +
+We've released BOINC version 2.0. +All BOINC components must be upgraded to major version 2. +We've upgraded the Astropulse server to 2.01 and +released BOINC core +client 2.01. +This was due to an architecture and protocol change in +specifying resource estimates and limits. +

+September 1, 2003 +
+BOINC server tools are now Python-based. A database +back-end API allows quick development of data-manipulation utilities. +

+August 15, 2003 +
+We rewrote parts of the scheduling server architecture to make operations +more flexible and efficient. +The timeout_check +daemon has been replaced by a more general transitioner daemon. +

July 25, 2003
We've added two new web-site features for BOINC projects: diff --git a/lib/error_numbers.h b/lib/error_numbers.h index b4dbd759d4..1a0cdaf6a6 100755 --- a/lib/error_numbers.h +++ b/lib/error_numbers.h @@ -102,3 +102,4 @@ #define ERR_SCHED_SHMEM -156 // sched shmem has bad contents #define ERR_ASYNCSELECT -157 +#define ERR_BAD_RESULT_STATE -158