- client: when a job finishes, read last (not first) 63KB of stderr

- client: parse <cpid_time> 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.

svn path=/trunk/boinc/; revision=13531
This commit is contained in:
David Anderson 2007-09-03 23:00:22 +00:00
parent 13b65a463a
commit dabba949a4
9 changed files with 77 additions and 38 deletions

View File

@ -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 <cpid_time> 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

View File

@ -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;

View File

@ -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, "</project>")) return 0;
else if (parse_str(buf, "<scheduler_url>", sched_url)) {
if (match_tag(buf, "</project>")) {
if (cpid_time == 0) {
cpid_time = user_create_time;
}
return 0;
}
if (parse_str(buf, "<scheduler_url>", 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>", host_venue, sizeof(host_venue))) continue;
if (parse_str(buf, "<email_hash>", email_hash, sizeof(email_hash))) continue;
if (parse_str(buf, "<cross_project_id>", cross_project_id, sizeof(cross_project_id))) continue;
if (parse_double(buf, "<cpid_time>", cpid_time)) continue;
if (parse_double(buf, "<user_total_credit>", user_total_credit)) continue;
if (parse_double(buf, "<user_expavg_credit>", user_expavg_credit)) continue;
if (parse_double(buf, "<user_create_time>", user_create_time)) continue;
@ -209,6 +216,7 @@ int PROJECT::write_state(MIOFILE& out, bool gui_rpc) {
" <host_venue>%s</host_venue>\n"
" <email_hash>%s</email_hash>\n"
" <cross_project_id>%s</cross_project_id>\n"
" <cpid_time>%f</cpid_time>\n"
" <user_total_credit>%f</user_total_credit>\n"
" <user_expavg_credit>%f</user_expavg_credit>\n"
" <user_create_time>%f</user_create_time>\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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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_name>", project->project_name, sizeof(project->project_name))) {
@ -604,6 +610,7 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) {
else if (parse_double(buf, "<user_total_credit>", project->user_total_credit)) continue;
else if (parse_double(buf, "<user_expavg_credit>", project->user_expavg_credit)) continue;
else if (parse_double(buf, "<user_create_time>", project->user_create_time)) continue;
else if (parse_double(buf, "<cpid_time>", cpid_time)) continue;
else if (parse_str(buf, "<team_name>", project->team_name, sizeof(project->team_name))) continue;
else if (parse_int(buf, "<hostid>", hostid)) continue;
else if (parse_double(buf, "<host_total_credit>", project->host_total_credit)) continue;

View File

@ -22,6 +22,7 @@
#endif
#include "stdwx.h"
#include "util.h"
#include "BOINCGUIApp.h"
#include "BOINCBaseFrame.h"
#include "MainDocument.h"

View File

@ -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);

View File

@ -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