From 88c741f0acadf8cfdcea9a71bbc19936951f35fd Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 24 Jan 2006 21:38:03 +0000 Subject: [PATCH] CPID consistency, larger trickle messages svn path=/trunk/boinc/; revision=9303 --- checkin_notes | 27 +++++++++++++++++++++++++++ client/acct_mgr.C | 7 +++++++ client/cs_scheduler.C | 31 +++++++++++++++---------------- clientgui/Events.h | 2 -- db/boinc_db.h | 6 ++++-- db/schema.sql | 4 ++-- sched/handle_request.C | 4 ++-- 7 files changed, 57 insertions(+), 24 deletions(-) diff --git a/checkin_notes b/checkin_notes index c224819e7c..a9e7741ade 100755 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/client/acct_mgr.C b/client/acct_mgr.C index 8404edbc72..ead140a157 100644 --- a/client/acct_mgr.C +++ b/client/acct_mgr.C @@ -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; iattached_via_acct_mgr = false; + } return 0; } diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 4a60e2b17c..8a44c92d1b 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -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; isched_rpc_pending = true; - } + for (unsigned int i=0; isched_rpc_pending = true; + projects[i]->min_rpc_time = 0; } } diff --git a/clientgui/Events.h b/clientgui/Events.h index 063c51ffbe..365e2cef8e 100644 --- a/clientgui/Events.h +++ b/clientgui/Events.h @@ -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 diff --git a/db/boinc_db.h b/db/boinc_db.h index 9f624a7c14..05bf29c4e6 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -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(); }; diff --git a/db/schema.sql b/db/schema.sql index a7250bbf09..e065f4b8f4 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -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; diff --git a/sched/handle_request.C b/sched/handle_request.C index bbda96fabb..c95daaac61 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -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) {