diff --git a/checkin_notes b/checkin_notes index 20706376f5..7f0844b2a6 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7685,7 +7685,7 @@ Rom 2 Aug 2007 lib/ stackwalker_win.cpp -Eric K 06 Aug 2007 +Eric K 06 Aug 2007 -added new functions boinc_suspend_graphics_thread() and boinc_resume_graphics_thread(), so apps can suspend the graphics threads for critical sections without suspending all threads. @@ -7740,10 +7740,10 @@ David 10 Aug 2007 str_util.C David 10 Aug 2007 - - Manager: show the AMS name, not the skin name, in Wizard + - Manager: show the AMS name, not the skin name, in Wizard - clientgui/ - WelcomePage.cpp + clientgui/ + WelcomePage.cpp David 10 Aug 2007 - Manager: change "Retry communications" to "Do network communication" @@ -7756,7 +7756,7 @@ David 10 Aug 2007 lib/ error_numbers.h -Janus 11 Aug 2007 +Janus 11 Aug 2007 - Added a DB table creation query for the BT file table html/bt/database/ @@ -7891,10 +7891,10 @@ David 16 Aug 2007 transitioner.C David 16 Aug 2007 - - screensaver fix + - screensaver fix - clientscr/ - screensaver_win.cpp + clientscr/ + screensaver_win.cpp Rom 16 Aug 2007 - MGR: Update skin manager for the following changes: @@ -7949,30 +7949,30 @@ Charlie 16 Aug 2007 BOINCMgr.icns David 16 Aug 2007 - - screensaver fix + - screensaver fix - api/ - graphics2_win.C - lib/ - util.C + api/ + graphics2_win.C + lib/ + util.C David 17 Aug 2007 - - client: change the way upload/download throughput - estimates are maintained. - The old way took concurrency into account but ignored compression; - the new way does the converse. - - client: maintain new stat: recent average transfer rates. - This track average up/down throughputs - (over wall clock time, not just while xfers are active) - with a half-life of 1 day. - Will eventually add a new pref: don't fetch new work if - either of these is above a threshold + - client: change the way upload/download throughput + estimates are maintained. + The old way took concurrency into account but ignored compression; + the new way does the converse. + - client: maintain new stat: recent average transfer rates. + This track average up/down throughputs + (over wall clock time, not just while xfers are active) + with a half-life of 1 day. + Will eventually add a new pref: don't fetch new work if + either of these is above a threshold - client/ - client_state.C - file_names.C - http_curl.C,h - net_stats.C,h + client/ + client_state.C + file_names.C + http_curl.C,h + net_stats.C,h Charlie 17 Aug 2007 MGR: Disable Simple GUI if the screen height < 600 (instead of== 480). @@ -8287,3 +8287,21 @@ Charlie 3 Sep 2007 clientscr/ mac_saver_module.cpp screensaver.cpp,h + +David 3 Sept 2007 + - client: when a job finishes, read last (not first) 63KB of stderr + - client: parse in scheduler reply; + add cpid_time field to PROJECT. + This defaults to the user_create_time. + In deciding which CPID to send in a scheduler request, + use the one with oldest cpid_time (not user_create_time). + This is the client half of fixing a bug that causes + CPID to flip/flop between to values in a certain case. + + client/ + app_control.C + client_types.C,h + cs_scheduler.C + scheduler_op.C + lib/ + util.C,h diff --git a/client/app_control.C b/client/app_control.C index f5a552c4cf..ac9114d775 100644 --- a/client/app_control.C +++ b/client/app_control.C @@ -586,7 +586,6 @@ bool ACTIVE_TASK::read_stderr_file() { // it's unlikely that more than that will be useful // int max_len = 63*1024; - sprintf(path, "%s/%s", slot_dir, STDERR_FILE); if (!boinc_file_exists(path)) return false; if (read_file_string(path, stderr_file, max_len)) return false; diff --git a/client/client_types.C b/client/client_types.C index 3c19d6cc27..b410a4f9f9 100644 --- a/client/client_types.C +++ b/client/client_types.C @@ -64,6 +64,7 @@ void PROJECT::init() { strcpy(team_name, ""); strcpy(email_hash, ""); strcpy(cross_project_id, ""); + cpid_time = 0; user_total_credit = 0; user_expavg_credit = 0; user_create_time = 0; @@ -125,8 +126,13 @@ int PROJECT::parse_state(MIOFILE& in) { init(); while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) return 0; - else if (parse_str(buf, "", sched_url)) { + if (match_tag(buf, "")) { + if (cpid_time == 0) { + cpid_time = user_create_time; + } + return 0; + } + if (parse_str(buf, "", sched_url)) { scheduler_urls.push_back(sched_url); continue; } @@ -138,6 +144,7 @@ int PROJECT::parse_state(MIOFILE& in) { if (parse_str(buf, "", host_venue, sizeof(host_venue))) continue; if (parse_str(buf, "", email_hash, sizeof(email_hash))) continue; if (parse_str(buf, "", cross_project_id, sizeof(cross_project_id))) continue; + if (parse_double(buf, "", cpid_time)) continue; if (parse_double(buf, "", user_total_credit)) continue; if (parse_double(buf, "", user_expavg_credit)) continue; if (parse_double(buf, "", user_create_time)) continue; @@ -209,6 +216,7 @@ int PROJECT::write_state(MIOFILE& out, bool gui_rpc) { " %s\n" " %s\n" " %s\n" + " %f\n" " %f\n" " %f\n" " %f\n" @@ -237,6 +245,7 @@ int PROJECT::write_state(MIOFILE& out, bool gui_rpc) { host_venue, email_hash, cross_project_id, + cpid_time, user_total_credit, user_expavg_credit, user_create_time, @@ -316,6 +325,7 @@ void PROJECT::copy_state_fields(PROJECT& p) { user_total_credit = p.user_total_credit; user_expavg_credit = p.user_expavg_credit; user_create_time = p.user_create_time; + cpid_time = p.cpid_time; rpc_seqno = p.rpc_seqno; hostid = p.hostid; host_total_credit = p.host_total_credit; diff --git a/client/client_types.h b/client/client_types.h index 36be7bb9ea..59722cca58 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -189,6 +189,7 @@ public: char team_name[256]; char email_hash[MD5_LEN]; char cross_project_id[MD5_LEN]; + double cpid_time; double user_total_credit; double user_expavg_credit; double user_create_time; diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 6467e958d0..6d92a2a236 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -183,9 +183,9 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { PROJECT* project = projects[i]; if (project == p) continue; if (strcmp(project->email_hash, p->email_hash)) continue; - if (project->user_create_time < winner->user_create_time) { + if (project->cpid_time < winner->cpid_time) { winner = project; - } else if (project->user_create_time == winner->user_create_time) { + } else if (project->cpid_time == winner->cpid_time) { if (strcmp(project->master_url, winner->master_url) < 0) { winner = project; } diff --git a/client/scheduler_op.C b/client/scheduler_op.C index 1931265570..690b955cd0 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -534,6 +534,7 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { std::string delete_file_name; mf.init_file(in); bool found_start_tag = false; + double cpid_time = 0; hostid = 0; request_delay = 0; @@ -591,6 +592,11 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { project->write_statistics_file(); + if (cpid_time) { + project->cpid_time = cpid_time; + } else { + project->cpid_time = project->user_create_time; + } return 0; } else if (parse_str(buf, "", project->project_name, sizeof(project->project_name))) { @@ -604,6 +610,7 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { else if (parse_double(buf, "", project->user_total_credit)) continue; else if (parse_double(buf, "", project->user_expavg_credit)) continue; else if (parse_double(buf, "", project->user_create_time)) continue; + else if (parse_double(buf, "", cpid_time)) continue; else if (parse_str(buf, "", project->team_name, sizeof(project->team_name))) continue; else if (parse_int(buf, "", hostid)) continue; else if (parse_double(buf, "", project->host_total_credit)) continue; diff --git a/clientgui/ViewWorkGrid.cpp b/clientgui/ViewWorkGrid.cpp index e58e38c941..ba0c0ed5b2 100644 --- a/clientgui/ViewWorkGrid.cpp +++ b/clientgui/ViewWorkGrid.cpp @@ -22,6 +22,7 @@ #endif #include "stdwx.h" +#include "util.h" #include "BOINCGUIApp.h" #include "BOINCBaseFrame.h" #include "MainDocument.h" diff --git a/lib/util.C b/lib/util.C index f0e43b7e5e..07527bd411 100755 --- a/lib/util.C +++ b/lib/util.C @@ -472,7 +472,7 @@ void boinc_crash() { // read file (at most max_len chars, if nonzero) into malloc'd buf // -int read_file_malloc(const char* path, char*& buf, int max_len) { +int read_file_malloc(const char* path, char*& buf, int max_len, bool tail) { FILE* f; int retval, isize; double size; @@ -484,6 +484,9 @@ int read_file_malloc(const char* path, char*& buf, int max_len) { if (!f) return ERR_FOPEN; if (max_len && size > max_len) { + if (tail) { + fseek(f, size-max_len, SEEK_SET); + } size = max_len; } isize = (int) size; @@ -496,12 +499,12 @@ int read_file_malloc(const char* path, char*& buf, int max_len) { // read file (at most max_len chars, if nonzero) into string // -int read_file_string(const char* path, string& result, int max_len) { +int read_file_string(const char* path, string& result, int max_len, bool tail) { result.erase(); int retval; char* buf; - retval = read_file_malloc(path, buf, max_len); + retval = read_file_malloc(path, buf, max_len, tail); if (retval) return retval; result = buf; free(buf); diff --git a/lib/util.h b/lib/util.h index 1258596ade..b7419a6849 100755 --- a/lib/util.h +++ b/lib/util.h @@ -99,7 +99,7 @@ extern int get_exit_status(int); extern int wait_client_mutex(const char* dir, double timeout); extern void boinc_crash(); -extern int read_file_malloc(const char* path, char*&, int max_len=0); -extern int read_file_string(const char* path, std::string&, int max_len=0); +extern int read_file_malloc(const char* path, char*&, int max_len=0, bool tail=false); +extern int read_file_string(const char* path, std::string&, int max_len=0, bool tail=false); #endif