connect bug; new host fields

svn path=/trunk/boinc/; revision=1516
This commit is contained in:
David Anderson 2003-06-17 18:59:36 +00:00
parent 9b73fe9562
commit 82a7071fc0
12 changed files with 135 additions and 17 deletions

View File

@ -4727,11 +4727,41 @@ Tim June 17, 2003
scheduler sends "openname_timestamp" as name
open_name (if available) is used when creating a slot directory
client\
client/
app.c
html_user\
html_user/
project_specific_prefs_ap.inc
sched\
sched/
handle_request.c
server_types.c
server_types.h
David June 17 2003
- If connect() fails, mark the HTTP_OP as done and in error.
Previously it just hung forever.
- Added DB fields for BOINC disk usage: total, project, and max
TODO: compute these on client and send in sched RPC
- Scheduler RPC request now includes a list of projects
and resource shares for the host.
Stored in the DB.
This lets the web site show other projects
that people participate in.
Also might be used in scheduling estimates.
- added a "Rules and policies" page to the web interface.
Users read this before creating account
- commented out check_max_mem_exceeded() (not ready)
todo
client/
app.C
cs_scheduler.C
http.C
db/
boinc_db.C,h
schema.sql
doc/
index.html
html_user/
create_account_form.php
index.php
info.php

View File

@ -636,6 +636,7 @@ bool ACTIVE_TASK::check_max_disk_exceeded() {
return false;
}
#if 0
// if an app has exceeded its maximum allowed memory, abort it
//
bool ACTIVE_TASK::check_max_mem_exceeded() {
@ -648,6 +649,7 @@ bool ACTIVE_TASK::check_max_mem_exceeded() {
}
return false;
}
#endif
// Check if any of the active tasks have exceeded their
// resource limits on disk, CPU time or memory
@ -660,7 +662,7 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() {
for (j=0;j<active_tasks.size();j++) {
atp = active_tasks[j];
if (atp->check_max_cpu_exceeded()) return true;
else if (atp->check_max_mem_exceeded()) return true;
//else if (atp->check_max_mem_exceeded()) return true;
else if (time(0)>last_disk_check_time + gstate.global_prefs.disk_interval) {
last_disk_check_time = time(0);
if (atp->check_max_disk_exceeded()) return true;

View File

@ -146,7 +146,7 @@ PROJECT* CLIENT_STATE::next_project(PROJECT* old) {
//
void CLIENT_STATE::compute_resource_debts() {
unsigned int i, j;
PROJECT* p, *pbest=NULL;
PROJECT* p, *pbest=0;
double best;
for (i=0; i<projects.size(); i++) {
@ -216,6 +216,20 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p, double work_req) {
fclose(fprefs);
}
fprintf(f, "<projects>\n");
for (i=0; i<projects.size(); i++ ) {
PROJECT* project = projects[i];
fprintf(f,
" <project>\n"
" <master_url>%s</master_url>\n"
" <resource_share>%f</resource_share>\n"
" </project>\n",
project->master_url,
project->resource_share
);
}
fprintf(f, "</projects>\n");
retval = time_stats.write(f, true);
if (retval) return retval;
retval = net_stats.write(f, true);
@ -324,6 +338,7 @@ int CLIENT_STATE::handle_scheduler_reply(
int retval;
unsigned int i;
bool signature_valid;
char buf[256];
nresults = 0;
contacted_sched_server = true;
@ -355,7 +370,7 @@ int CLIENT_STATE::handle_scheduler_reply(
project->user_create_time = sr.user_create_time;
if (strlen(sr.message)) {
int prio = (!strcmp(sr.message_priority, "high"))?MSG_ERROR:MSG_INFO;
msg_printf(project, prio, sr.message);
show_message(project, sr.message, prio);
}
if (sr.request_delay) {
@ -391,7 +406,6 @@ int CLIENT_STATE::handle_scheduler_reply(
retval = global_prefs.parse_file(host_venue);
if (retval) return retval;
install_global_prefs();
set_nslots();
}
// deal with project preferences (should always be there)
@ -490,7 +504,8 @@ int CLIENT_STATE::handle_scheduler_reply(
rp->state = RESULT_NEW;
nresults++;
} else {
msg_printf(project, MSG_ERROR, "Already have result %s\n", sr.results[i].name);
sprintf(buf, "Already have result %s\n", sr.results[i].name);
show_message(project, buf, MSG_ERROR);
}
}
@ -504,8 +519,10 @@ int CLIENT_STATE::handle_scheduler_reply(
if (rp) {
rp->server_ack = true;
} else {
msg_printf(project, MSG_ERROR, "Got ack for result %s, can't find\n",
sr.result_acks[i].name);
sprintf(buf, "Got ack for result %s, can't find\n",
sr.result_acks[i].name
);
show_message(project, buf, MSG_ERROR);
}
}
project->sched_rpc_pending = false;

View File

@ -334,6 +334,11 @@ bool HTTP_OP_SET::poll() {
htp = http_ops[i];
switch(htp->http_op_state) {
case HTTP_STATE_CONNECTING:
if (htp->error) {
htp->http_op_state = HTTP_STATE_DONE;
htp->http_op_retval = ERR_CONNECT;
break;
}
if (htp->is_connected) {
htp->http_op_state = HTTP_STATE_REQUEST_HEADER;
htp->want_upload = true;

View File

@ -468,9 +468,10 @@ void DB_HOST::db_print(char* buf){
"os_name='%s', os_version='%s', "
"m_nbytes=%f, m_cache=%f, m_swap=%f, "
"d_total=%f, d_free=%f, "
"d_boinc_used_total=%f, d_boinc_used_project=%f, d_boinc_max=%f, "
"n_bwup=%f, n_bwdown=%f, "
"credit_per_cpu_sec=%f, "
"venue='%s'",
"venue='%s', projects='%s'",
id, create_time, userid,
rpc_seqno, rpc_time,
total_credit, expavg_credit, expavg_time,
@ -482,9 +483,10 @@ void DB_HOST::db_print(char* buf){
os_name, os_version,
m_nbytes, m_cache, m_swap,
d_total, d_free,
d_boinc_used_total, d_boinc_used_project, d_boinc_max,
n_bwup, n_bwdown,
credit_per_cpu_sec,
venue
venue, projects
);
unescape_single_quotes(domain_name);
unescape_single_quotes(serialnum);
@ -527,10 +529,14 @@ void DB_HOST::db_parse(MYSQL_ROW &r) {
m_swap = atof(r[i++]);
d_total = atof(r[i++]);
d_free = atof(r[i++]);
d_boinc_used_total = atof(r[i++]);
d_boinc_used_project = atof(r[i++]);
d_boinc_max = atof(r[i++]);
n_bwup = atof(r[i++]);
n_bwdown = atof(r[i++]);
credit_per_cpu_sec = atof(r[i++]);
strcpy2(venue, r[i++]);
strcpy2(projects, r[i++]);
}
void DB_WORKUNIT::db_print(char* buf){

View File

@ -203,9 +203,18 @@ struct HOST {
double m_cache; // Size of CPU cache in bytes (L1 or L2?)
double m_swap; // Size of swap space in bytes
double d_total; // Total disk space
double d_free;
double d_total; // Total disk space on host
// - may include all volumes,
// even if BOINC can use only one of them
// - may include network (shared) storage
double d_free; // Of the total disk space, how much is free
double d_boinc_used_total;
// amount being used for all projects
double d_boinc_used_project;
// amount being used for this project
double d_boinc_max; // max amount that BOINC is allowed to use
// This reflects both user preferences
// and the fact that BOINC can use only 1 volume
double n_bwup; // Average upload bandwidth, bytes/sec
double n_bwdown; // Average download bandwidth, bytes/sec
@ -213,6 +222,8 @@ struct HOST {
double credit_per_cpu_sec;
char venue[256]; // home/work/school
char projects[MAX_BLOB_SIZE];
// list of projects this host is attached to (XML)
int parse(FILE*);
int parse_time_stats(FILE*);

View File

@ -121,12 +121,16 @@ create table host (
d_total double not null,
d_free double not null,
d_boinc_used_total double not null,
d_boinc_used_project double not null,
d_boinc_max double not null,
n_bwup double not null,
n_bwdown double not null,
credit_per_cpu_sec double not null,
venue varchar(254) not null,
projects blob,
primary key (id)
);

View File

@ -51,6 +51,7 @@ Help debug and enhance the BOINC software.
<br>
&nbsp;&nbsp;&nbsp;
<a href=http://www.equn.com/boinchina><font size=-1>Chinese</font></a>
<a href=http://boinc.tmac.pri.ee><font size=-1>Estonian</font></a>
<a href=http://www.boinc-fr.net><font size=-1>French</font></a>
<a href=http://www.boinc.de/><font size=-1>German</font></a>
<a href=http://www.boinc.narod.ru><font size=-1>Russian</font></a>

View File

@ -16,8 +16,13 @@ page_head("Create account");
echo "<h3>Create an account with ".PROJECT."</h3>
<form method=post action=create_account_action.php>
<p>
<b>Read the <a href=info.php>rules and policies</a> before creating
an account</b>
<p>
";
start_table();
row2("<b>Name</b>
<br><font size=-1>

View File

@ -12,6 +12,7 @@
<h3>Join ".PROJECT." </h3>
<p>
<ul>
<li><a href=info.php>Rules and policies <b>[read this first]</b></a>
<li><a href=create_account_form.php>Create an account</a>
</ul>

View File

@ -1,6 +1,6 @@
Mon Jun 16 17:22:36 PDT 2003
<?php
// Generated by db_def_to_php on Wed Jun 11 15:32:05 PDT 2003
define("MAX_BLOB_SIZE", 4096);
// Generated by db_def_to_php on define("MAX_BLOB_SIZE", 4096);
define("TEAM_TYPE_CLUB", 1);
define("TEAM_TYPE_COMPANY", 2);
define("TEAM_TYPE_PRIMARY", 3);

36
todo
View File

@ -1,4 +1,40 @@
DON'T ADD ANYTHING TO HERE. USE THE TASKBASE INSTEAD.
File upload handler should check for disk full,
return transient error, alert admins
If there are no active tasks, should start downloading
only the files for a particular result (avoid idle CPU)
Scheduler: don't send results whose deadlines will be missed.
This must take into account:
- pending work on host
- speed of host
- active fraction of host
- network speed of host
- results already in reply
Web site:
show mean, stddev of stats of active hosts
show max potential cobblestones (and percentage achieved)
Web site:
show table of size, MD5 of all executable files
break down by platform
Each RPC should contain a list of projects the host is attached to,
and their resource shares
Add field to user for the above list
Show above info on the web site
Implement coprocessor stuff (see platform.html)
add platform_details field to client state file
pass it in to every app
app can modify it if it wants
send back platform_details field with RPC
store in host table (and in result? make new host if it changes?)
add disk_avail field to host
send in RPC
use this in scheduling
Make sure "update prefs" works even if suspended
In GUI, show "suspended" on tasks and transfers if suspended
Clarify once and for all messages and other logs on Windows;
policy for truncating log files?
-----------------------
BUGS (arranged from high to low priority)
-----------------------