mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=2840
This commit is contained in:
parent
db57060a20
commit
f4d30aa220
|
@ -8805,3 +8805,38 @@ David 30 Dec 2003
|
|||
|
||||
client/
|
||||
client_types.C,h
|
||||
|
||||
David 31 Dec 2003
|
||||
- Made the basic test script (test_uc.py) work again:
|
||||
- fixed syntax errors in SQL files
|
||||
- initial config.xml file includes <host> element
|
||||
- back-end processes handle SIGHUP, not SIGINT
|
||||
(we changed in "start"; need to change here too)
|
||||
- "MIN_SENDWORK_INTERVAL" is read from config.xml (default 0)
|
||||
- added 12-second sleep in run_check_all()
|
||||
(based on 10-sec sleep in assimilator; should reduce)
|
||||
- The user and admin web interfaces now work in the basic test case
|
||||
(i.e. you can use html_ops to look at DB contents)
|
||||
|
||||
db/
|
||||
constraints.sql
|
||||
schema.sql
|
||||
html_ops/
|
||||
db_ops.inc
|
||||
html_user/
|
||||
project.inc.sample
|
||||
util.inc
|
||||
py/Boinc/
|
||||
setup_project.py
|
||||
sched/
|
||||
assimilator.C
|
||||
feeder.C
|
||||
file_deleter.C
|
||||
handle_request.C
|
||||
make_work.C
|
||||
sched_config.C,h
|
||||
sched_util.C,h
|
||||
transitioner.C
|
||||
validate.C
|
||||
test/
|
||||
testbase.py
|
||||
|
|
|
@ -49,9 +49,9 @@ alter table result
|
|||
add unique(name),
|
||||
-- the scheduler looks up results by name
|
||||
|
||||
//add index res_wuid (workunitid),
|
||||
// -- transitioner
|
||||
// -- NOTE: res_wu_user may suffice; could try dropping this one
|
||||
add index res_wuid (workunitid),
|
||||
-- transitioner
|
||||
-- NOTE res_wu_user may suffice, could try dropping this one
|
||||
|
||||
add index ind_res_st (server_state, random),
|
||||
-- feeder (random is to avoid sending WU result close together)
|
||||
|
@ -86,7 +86,7 @@ alter table host
|
|||
-- db_dump.C
|
||||
|
||||
alter table profile
|
||||
add fulltext index profile_reponse(response1, reponse2),
|
||||
add fulltext index profile_reponse(response1, response2),
|
||||
add unique profile_userid(userid);
|
||||
|
||||
alter table subscriptions
|
||||
|
|
|
@ -304,7 +304,7 @@ create table thread (
|
|||
-- number of postings in thread
|
||||
activity double not null,
|
||||
-- for questions: number of askers / time since asked
|
||||
(set periodically by update_forum_activity.php)
|
||||
-- (set periodically by update_forum_activity.php)
|
||||
sufferers integer not null,
|
||||
-- in help desk: # people who indicated they had same problem
|
||||
create_time integer not null,
|
||||
|
|
|
@ -8,7 +8,7 @@ function db_init() {
|
|||
}
|
||||
$db_name = parse_config("<db_name>");
|
||||
if(!mysql_select_db($db_name)) {
|
||||
echo "Unable to select database - please try again later";
|
||||
echo "Unable to select database '$db_name' - please try again later";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
|
|
@ -64,4 +64,8 @@ Tell us your thoughts about " . PROJECT . "<ol>
|
|||
");
|
||||
}
|
||||
|
||||
function project_news() {
|
||||
echo "No news is good news\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once("project_specific/project.inc");
|
||||
require_once("../html_user/project_specific/project.inc");
|
||||
require_once("countries.inc");
|
||||
|
||||
// Sends the authenticator to the given email address
|
||||
|
@ -301,15 +301,9 @@ function parse_element($xml, $tag) {
|
|||
//
|
||||
function parse_config($tag, $pathMod='') {
|
||||
$element = null;
|
||||
$fp = fopen($pathMod . "../config.xml", "r");
|
||||
while (1) {
|
||||
$buf = fgets($fp, 1024);
|
||||
if ($buf == null) break;
|
||||
$element = parse_element($buf, $tag);
|
||||
if ($element) break;
|
||||
}
|
||||
fclose($fp);
|
||||
return $element;
|
||||
$buf = file_get_contents($pathMod . "../config.xml");
|
||||
$element = parse_element($buf, $tag);
|
||||
return trim($element);
|
||||
}
|
||||
|
||||
// Call this if for dynamic pages
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import boinc_path_config
|
||||
from Boinc import database, db_mid, configxml, tools
|
||||
from Boinc.boinc_db import *
|
||||
import os, sys, glob, time, shutil, re, random
|
||||
import os, sys, glob, time, shutil, re, random, socket
|
||||
|
||||
class Options:
|
||||
pass
|
||||
|
@ -303,6 +303,7 @@ class Project:
|
|||
config.db_passwd = ''
|
||||
config.shmem_key = generate_shmem_key()
|
||||
config.output_level = 3
|
||||
config.host = socket.gethostname()
|
||||
|
||||
config.master_url = master_url or os.path.join(options.html_url , self.short_name , '')
|
||||
config.download_url = os.path.join(config.master_url, 'download')
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
|
||||
SCHED_CONFIG config;
|
||||
|
||||
#define SLEEP_INTERVAL 10
|
||||
|
||||
// assimilate all WUs that need it
|
||||
// return nonzero if did anything
|
||||
//
|
||||
|
@ -125,12 +127,12 @@ int main(int argc, char** argv) {
|
|||
log_messages.printf(SchedMessages::CRITICAL, "Can't find app\n");
|
||||
exit(1);
|
||||
}
|
||||
install_sigint_handler();
|
||||
install_stop_signal_handler();
|
||||
if (one_pass) {
|
||||
do_pass(app);
|
||||
} else {
|
||||
while (1) {
|
||||
if (!do_pass(app)) sleep(10);
|
||||
if (!do_pass(app)) sleep(SLEEP_INTERVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -375,7 +375,7 @@ int main(int argc, char** argv) {
|
|||
ssp->init();
|
||||
|
||||
atexit(cleanup_shmem);
|
||||
install_sigint_handler();
|
||||
install_stop_signal_handler();
|
||||
|
||||
retval = boinc_db.open(config.db_name, config.db_host, config.db_passwd);
|
||||
if (retval) {
|
||||
|
|
|
@ -173,7 +173,7 @@ int main(int argc, char** argv) {
|
|||
log_messages.printf(SchedMessages::CRITICAL, "can't open DB\n");
|
||||
exit(1);
|
||||
}
|
||||
install_sigint_handler();
|
||||
install_stop_signal_handler();
|
||||
if (one_pass) {
|
||||
do_pass();
|
||||
} else {
|
||||
|
|
|
@ -44,7 +44,6 @@ 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;
|
||||
|
||||
|
@ -1032,15 +1031,20 @@ void process_request(
|
|||
|
||||
handle_results(sreq, reply, reply.host);
|
||||
|
||||
// if last RPC was within MIN_SENDWORK_INTERVAL, don't send work
|
||||
// if last RPC was within config.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 {
|
||||
bool ok_to_send = true;
|
||||
if (config.min_sendwork_interval) {
|
||||
double diff = dtime() - last_rpc_time;
|
||||
if (diff < config.min_sendwork_interval) {
|
||||
ok_to_send = false;
|
||||
log_messages.printf(
|
||||
SchedMessages::NORMAL,
|
||||
"Not sending work - last RPC too recent: %f\n", diff
|
||||
);
|
||||
}
|
||||
}
|
||||
if (ok_to_send) {
|
||||
send_work(sreq, reply, *platform, ss);
|
||||
}
|
||||
|
||||
|
|
|
@ -298,7 +298,7 @@ int main(int argc, char** argv) {
|
|||
"Starting: min_quorum=%d target_nresults=%d max_error_results=%d max_total_results=%d max_success_results=%d\n",
|
||||
min_quorum, target_nresults, max_error_results, max_total_results, max_success_results
|
||||
);
|
||||
install_sigint_handler();
|
||||
install_stop_signal_handler();
|
||||
|
||||
srand48(getpid() + time(0));
|
||||
make_work();
|
||||
|
|
|
@ -59,6 +59,7 @@ int SCHED_CONFIG::parse(istream& f) {
|
|||
if (match_tag(buf.c_str(), "<one_result_per_user_per_wu/>")) {
|
||||
one_result_per_user_per_wu = true;
|
||||
}
|
||||
parse_int(buf.c_str(), "<min_sendwork_interval>", min_sendwork_interval);
|
||||
if (match_tag(buf.c_str(), "</config>")) return 0;
|
||||
return ERR_XML_PARSE;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
char upload_dir[256];
|
||||
char user_name[256];
|
||||
bool one_result_per_user_per_wu;
|
||||
int min_sendwork_interval;
|
||||
|
||||
int parse(istream& f);
|
||||
int parse_file(char* dir=".");
|
||||
|
|
|
@ -31,6 +31,9 @@ using namespace std;
|
|||
#include "server_types.h"
|
||||
|
||||
const char* STOP_TRIGGER_FILENAME = "../stop_servers";
|
||||
// NOTE: this be the same name as used by the "start" script
|
||||
const int STOP_SIGNAL = SIGHUP;
|
||||
// NOTE: this be the same signal as used by the "start" script
|
||||
|
||||
void write_pid_file(const char* filename) {
|
||||
FILE* fpid = fopen(filename, "w");
|
||||
|
@ -43,19 +46,19 @@ void write_pid_file(const char* filename) {
|
|||
}
|
||||
|
||||
// caught_sig_int will be set to true if SIGINT is caught.
|
||||
bool caught_sig_int = false;
|
||||
static void sigint_handler(int) {
|
||||
fprintf(stderr, "SIGINT\n");
|
||||
caught_sig_int = true;
|
||||
bool caught_stop_signal = false;
|
||||
static void stop_signal_handler(int) {
|
||||
fprintf(stderr, "GOT STOP SIGNAL\n");
|
||||
caught_stop_signal = true;
|
||||
}
|
||||
|
||||
void install_sigint_handler() {
|
||||
signal(SIGINT, sigint_handler);
|
||||
// SIGINT is now default again so hitting ^C again will kill the program.
|
||||
void install_stop_signal_handler() {
|
||||
signal(STOP_SIGNAL, stop_signal_handler);
|
||||
// handler is now default again so hitting ^C again will kill the program.
|
||||
}
|
||||
|
||||
void check_stop_trigger() {
|
||||
if (caught_sig_int) {
|
||||
if (caught_stop_signal) {
|
||||
log_messages.printf(SchedMessages::CRITICAL, "Quitting due to SIGINT\n");
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -45,8 +45,8 @@ extern void set_debug_level(int);
|
|||
extern void check_stop_trigger();
|
||||
extern bool is_stopfile_present();
|
||||
extern void update_average(double, double, double&, double&);
|
||||
extern void install_sigint_handler();
|
||||
extern bool caught_sig_int;
|
||||
extern void install_stop_signal_handler();
|
||||
extern bool caught_stop_signal;
|
||||
|
||||
|
||||
class SchedMessages : public Messages {
|
||||
|
|
|
@ -415,7 +415,7 @@ int main(int argc, char** argv) {
|
|||
// write_pid_file(PIDFILE);
|
||||
log_messages.printf(SchedMessages::NORMAL, "Starting\n");
|
||||
|
||||
install_sigint_handler();
|
||||
install_stop_signal_handler();
|
||||
|
||||
main_loop(one_pass);
|
||||
}
|
||||
|
|
|
@ -391,7 +391,7 @@ int main(int argc, char** argv) {
|
|||
// write_pid_file(PIDFILE);
|
||||
log_messages.printf(SchedMessages::NORMAL, "Starting validator\n");
|
||||
|
||||
install_sigint_handler();
|
||||
install_stop_signal_handler();
|
||||
|
||||
main_loop(one_pass);
|
||||
}
|
||||
|
|
|
@ -318,7 +318,7 @@ class TestProject(Project):
|
|||
def run(self):
|
||||
self.sched_install('make_work', max_wus = self.num_wu, min_quorum = self.redundancy)
|
||||
self.sched_install('assimilator')
|
||||
# self.sched_install('file_deleter')
|
||||
self.sched_install('file_deleter')
|
||||
self.sched_install('validate_test')
|
||||
self.sched_install('feeder')
|
||||
self.sched_install('transitioner')
|
||||
|
@ -670,6 +670,7 @@ def run_check_all():
|
|||
all_projects.stop_progress_meter()
|
||||
print
|
||||
# all_hosts.stop()
|
||||
time.sleep(12)
|
||||
all_projects.stop()
|
||||
all_projects.check()
|
||||
|
||||
|
|
Loading…
Reference in New Issue