CPID consistency, larger trickle messages

svn path=/trunk/boinc/; revision=9303
This commit is contained in:
David Anderson 2006-01-24 21:38:03 +00:00
parent 11feb28421
commit 88c741f0ac
7 changed files with 57 additions and 24 deletions

View File

@ -894,3 +894,30 @@ Rom 24 Jan 2005
clientgui/
MainFrame.cpp
David 24 Jan 2005
- core client: move code that deals with generating new host CPID
to the end of handle_scheduler_reply(),
after the part that clears sched_rpc_pending and sets min_rpc_time,
since if we generate a new host CPID
we're going to modify these (to request another RPC).
Also: in this case request an immediate scheduler RPC to all projects
whether or not we're using an account manager.
- core client: if detach from account manager,
clear "attached_via_acct_mgr" flag on all projects
- database: change type of xml field in msg_to_host and msg_from_host
from text (64KB limit)
to medium_text (16MB limit, but use at most 256KB)
- scheduler: don't print trickle message contents (swamps logfile)
(the latter two from Carl Christensen)
client/
acct_mgr.C
cs_scheduler.C
clientgui/
Events.h
db/
boinc_db.h
schema.sql
sched/
handle_request.C

View File

@ -39,6 +39,9 @@
static const char *run_mode_name[] = {"", "always", "auto", "never"};
// do an account manager RPC;
// if url is null, detach from current account manager
//
int ACCT_MGR_OP::do_rpc(
std::string url, std::string name, std::string password_hash
) {
@ -57,6 +60,10 @@ int ACCT_MGR_OP::do_rpc(
boinc_delete_file(ACCT_MGR_URL_FILENAME);
boinc_delete_file(ACCT_MGR_LOGIN_FILENAME);
error_num = 0;
for (i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
p->attached_via_acct_mgr = false;
}
return 0;
}

View File

@ -743,16 +743,6 @@ int CLIENT_STATE::handle_scheduler_reply(
return ERR_PROJECT_DOWN;
}
// The project returns a hostid only if it has created a new host record.
// In that case we should reset RPC seqno
// and generate a new host CPID
//
if (sr.hostid) {
project->hostid = sr.hostid;
project->rpc_seqno = 0;
generate_new_host_cpid();
}
// see if we have a new venue from this project
//
if (strlen(sr.host_venue) && strcmp(project->host_venue, sr.host_venue)) {
@ -1026,6 +1016,17 @@ int CLIENT_STATE::handle_scheduler_reply(
project->min_rpc_time = 0;
}
// The project returns a hostid only if it has created a new host record.
// In that case we should reset RPC seqno
// and generate a new host CPID
//
if (sr.hostid) {
project->hostid = sr.hostid;
project->rpc_seqno = 0;
generate_new_host_cpid();
msg_printf(project, MSG_INFO, "Generated new host CPID: %s", host_info.host_cpid);
}
set_client_state_dirty("handle_scheduler_reply");
scope_messages.printf("CLIENT_STATE::handle_scheduler_reply(): State after handle_scheduler_reply():\n");
print_summary();
@ -1432,15 +1433,13 @@ void CLIENT_STATE::scale_duration_correction_factors(double factor) {
}
// Choose a new host CPID.
// If we're using an account manager, do scheduler RPCs to all projects
// to propagate the CPID
// Do scheduler RPCs to all projects to propagate the CPID
//
void CLIENT_STATE::generate_new_host_cpid() {
host_info.generate_host_cpid();
if (strlen(acct_mgr_info.login_name)) {
for (unsigned int i=0; i<projects.size(); i++) {
projects[i]->sched_rpc_pending = true;
}
for (unsigned int i=0; i<projects.size(); i++) {
projects[i]->sched_rpc_pending = true;
projects[i]->min_rpc_time = 0;
}
}

View File

@ -84,13 +84,11 @@
#define ID_TASK_STATISTICS_USERAVERAGE 9501
#define ID_TASK_STATISTICS_HOSTTOTAL 9502
#define ID_TASK_STATISTICS_HOSTAVERAGE 9503
///----------\\//-----------mifistor--------------\\//------------------
#define ID_TASK_STATISTICS_NEXTPROJECT 9601
#define ID_TASK_STATISTICS_PREVPROJECT 9602
#define ID_TASK_STATISTICS_MODEVIEW0 9610
#define ID_TASK_STATISTICS_MODEVIEW1 9611
#define ID_TASK_STATISTICS_MODEVIEW2 9612
///----------//\\-----------mifistor--------------//\\------------------
#endif

View File

@ -38,6 +38,8 @@ extern DB_CONN boinc_db;
// Large is for fields with user-supplied text, and preferences
#define LARGE_BLOB_SIZE 65536
#define MSG_FROM_HOST_BLOB_SIZE 262144
#define MSG_TO_HOST_BLOB_SIZE 262144
// Dummy name for file xfers
#define FILE_MOVER "move_file"
@ -449,7 +451,7 @@ struct MSG_FROM_HOST {
int hostid;
char variety[256]; // project-defined; what kind of msg
bool handled; // message handler has processed this
char xml[LARGE_BLOB_SIZE];
char xml[MSG_FROM_HOST_BLOB_SIZE];
void clear();
};
@ -459,7 +461,7 @@ struct MSG_TO_HOST {
int hostid;
char variety[256]; // project-defined; what kind of msg
bool handled; // scheduler has sent this
char xml[LARGE_BLOB_SIZE]; // text to include in sched reply
char xml[MSG_TO_HOST_BLOB_SIZE]; // text to include in sched reply
void clear();
};

View File

@ -255,7 +255,7 @@ create table msg_from_host (
hostid integer not null,
variety varchar(254) not null,
handled smallint not null,
xml text,
xml mediumtext,
primary key (id)
) type=InnoDB;
@ -265,7 +265,7 @@ create table msg_to_host (
hostid integer not null,
variety varchar(254) not null,
handled smallint not null,
xml text,
xml mediumtext,
primary key (id)
) type=InnoDB;

View File

@ -930,8 +930,8 @@ void handle_msgs_from_host(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
safe_strcpy(mfh.xml, md.msg_text.c_str());
log_messages.printf(
SCHED_MSG_LOG::MSG_NORMAL,
"got msg from host; variety %s text %s\n",
mfh.variety, mfh.xml
"got msg from host; variety %s \n",
mfh.variety
);
retval = mfh.insert();
if (retval) {