mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=2821
This commit is contained in:
parent
c57e494def
commit
18d8b5dd6c
|
@ -8638,3 +8638,22 @@ David 21 Dec 2003
|
|||
profile_search_action.php
|
||||
user.inc
|
||||
user_search_action.php (new)
|
||||
|
||||
David 23 Dec 2003
|
||||
- add mechanism to prevent server spamming
|
||||
(i.e. frequence requests for work from a single host).
|
||||
The mechanism: if the last RPC was within 15 minutes,
|
||||
don't send any work.
|
||||
- add result.exit_status field to DB
|
||||
Currently this is populated by the server,
|
||||
if there's a <exit_status> element in the reply's stderr_out.
|
||||
There may be a better way to do this.
|
||||
TODO: display this field in the web GUI
|
||||
- use SIGHUP instead of SIGINT to stop daemon processes
|
||||
|
||||
db/
|
||||
boinc_db.C,h
|
||||
schema.sql
|
||||
sched/
|
||||
handle_request.C
|
||||
start
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
// Contributor(s):
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.29 2003/12/23 19:21:51 boincadm
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.28 2003/12/18 00:22:23 boincadm
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -488,7 +491,7 @@ void DB_RESULT::db_print(char* buf){
|
|||
"xml_doc_in='%s', xml_doc_out='%s', stderr_out='%s', "
|
||||
"batch=%d, file_delete_state=%d, validate_state=%d, "
|
||||
"claimed_credit=%.15e, granted_credit=%.15e, opaque=%f, random=%d, "
|
||||
"client_version_num=%d, appid=%d",
|
||||
"client_version_num=%d, appid=%d, exit_status=%d",
|
||||
id, create_time, workunitid,
|
||||
server_state, outcome, client_state,
|
||||
hostid, userid,
|
||||
|
@ -497,7 +500,7 @@ void DB_RESULT::db_print(char* buf){
|
|||
xml_doc_in, xml_doc_out, stderr_out,
|
||||
batch, file_delete_state, validate_state,
|
||||
claimed_credit, granted_credit, opaque, random,
|
||||
client_version_num, appid
|
||||
client_version_num, appid, exit_status
|
||||
);
|
||||
unescape_single_quotes(xml_doc_out);
|
||||
unescape_single_quotes(stderr_out);
|
||||
|
@ -531,6 +534,7 @@ void DB_RESULT::db_parse(MYSQL_ROW &r) {
|
|||
random = atoi(r[i++]);
|
||||
client_version_num = atoi(r[i++]);
|
||||
appid = atoi(r[i++]);
|
||||
exit_status = atoi(r[i++]);
|
||||
}
|
||||
|
||||
int DB_RESULT::insert() {
|
||||
|
|
|
@ -407,6 +407,7 @@ struct RESULT {
|
|||
int random; // determines send order
|
||||
int client_version_num;
|
||||
int appid; // copy of WU's appid
|
||||
int exit_status; // application exit status, if any
|
||||
|
||||
// the following not used in the DB
|
||||
char wu_name[256];
|
||||
|
|
|
@ -218,6 +218,7 @@ create table result (
|
|||
random integer not null,
|
||||
client_version_num integer not null,
|
||||
appid integer not null,
|
||||
exit_status integer not null,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ using namespace std;
|
|||
const int MIN_SECONDS_TO_SEND = 0;
|
||||
const int MAX_SECONDS_TO_SEND = (28*SECONDS_PER_DAY);
|
||||
const int MAX_WUS_TO_SEND = 10;
|
||||
const int MIN_SENDWORK_INTERVAL = 15*60;
|
||||
|
||||
const double COBBLESTONE_FACTOR = 300.0;
|
||||
|
||||
|
@ -335,7 +336,6 @@ int authenticate_user(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
|
|||
goto new_host;
|
||||
}
|
||||
reply.host.rpc_seqno = sreq.rpc_seqno;
|
||||
reply.host.rpc_time = time(0);
|
||||
} else {
|
||||
// here no hostid was given; we'll have to create a new host record
|
||||
//
|
||||
|
@ -368,7 +368,6 @@ new_host:
|
|||
host.create_time = time(0);
|
||||
host.userid = reply.user.id;
|
||||
host.rpc_seqno = 0;
|
||||
host.rpc_time = time(0);
|
||||
strcpy(host.venue, reply.user.venue);
|
||||
retval = host.insert();
|
||||
if (retval) {
|
||||
|
@ -559,6 +558,11 @@ int handle_results(
|
|||
}
|
||||
}
|
||||
|
||||
// look for exit status in stderr_out
|
||||
// TODO: return separately
|
||||
//
|
||||
parse_int(result.stderr_out, "<exit_status>", result.exit_status);
|
||||
|
||||
// update the result record in DB
|
||||
//
|
||||
result.hostid = reply.host.id;
|
||||
|
@ -993,6 +997,7 @@ void process_request(
|
|||
) {
|
||||
PLATFORM* platform;
|
||||
int retval;
|
||||
double last_rpc_time;
|
||||
|
||||
// if different major version of BOINC, just send a message
|
||||
//
|
||||
|
@ -1001,6 +1006,8 @@ void process_request(
|
|||
retval = authenticate_user(sreq, reply);
|
||||
if (retval) return;
|
||||
|
||||
last_rpc_time = reply.host.rpc_time;
|
||||
reply.host.rpc_time = time(0);
|
||||
retval = update_host_record(sreq, reply.host);
|
||||
|
||||
// look up the client's platform in the DB
|
||||
|
@ -1028,7 +1035,17 @@ void process_request(
|
|||
|
||||
handle_results(sreq, reply, reply.host);
|
||||
|
||||
send_work(sreq, reply, *platform, ss);
|
||||
// if last RPC was within MIN_SENDWORK_INTERVAL, don't send work
|
||||
//
|
||||
double diff = dtime() - last_rpc_time;
|
||||
if (diff < MIN_SENDWORK_INTERVAL) {
|
||||
log_messages.printf(
|
||||
SchedMessages::NORMAL,
|
||||
"Not sending work - last RPC too recent: %f\n", diff
|
||||
);
|
||||
} else {
|
||||
send_work(sreq, reply, *platform, ss);
|
||||
}
|
||||
|
||||
send_code_sign_key(sreq, reply, code_sign_key);
|
||||
}
|
||||
|
|
|
@ -68,8 +68,8 @@ See "start --help" for options.
|
|||
|
||||
Daemons:
|
||||
These are continuously-running programs.
|
||||
The process ID is recorded in the <pid_dir>
|
||||
directory and the process is sent a SIGINT in a DISABLE operation.
|
||||
The process ID is recorded in the <pid_dir> directory
|
||||
and the process is sent a SIGHUP in a DISABLE operation.
|
||||
|
||||
Both tasks and daemons can run on a different host (specified by <host>).
|
||||
The default is the project's main host,
|
||||
|
@ -433,7 +433,7 @@ def run_tasks():
|
|||
def stop_daemon(pid):
|
||||
'''returns 1 if something stopped, else 0'''
|
||||
try:
|
||||
os.kill(pid, signal.SIGINT)
|
||||
os.kill(pid, signal.SIGHUP)
|
||||
except OSError, e:
|
||||
if e.errno != 3:
|
||||
print >>sys.stderr, "Warning: couldn't kill pid %d:"%pid, e
|
||||
|
|
Loading…
Reference in New Issue