From 46da85016661aac6338328ab83123a46f583c56c Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 3 Mar 2006 20:22:25 +0000 Subject: [PATCH] fix rpc_seqno bug (client fix) svn path=/trunk/boinc/; revision=9596 --- checkin_notes | 12 ++++++++++++ client/cs_scheduler.C | 18 ++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index b5a131285b..a19083f07f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -2549,3 +2549,15 @@ David 2 Mar 2006 client/ cs_scheduler.C + +David 3 Mar 2006 + - core client: on scheduler RPC, if our host ID is zero, + set RPC seqno to zero also. + This avoids a bug where the scheduler creates a new host record + with rpc_seqno zero, and then on the next RPC creates + ANOTHER host record because the client's rpc_seqno is > 0 + - core client: propagate host CPID change only + if we're using an account manager. + + client/ + cs_scheduler.C diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 53e67f5739..272c8b2fba 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -237,6 +237,12 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { prrs_fraction = 1; } + // if hostid is zero, rpc_seqno better be also + // + if (!p->hostid) { + p->rpc_seqno = 0; + } + if (!f) return ERR_FOPEN; mf.init_file(f); fprintf(f, @@ -1025,6 +1031,7 @@ int CLIENT_STATE::handle_scheduler_reply( // and generate a new host CPID // if (sr.hostid) { + //msg_printf(project, MSG_INFO, "Changing host ID from %d to %d", project->hostid, sr.hostid); project->hostid = sr.hostid; project->rpc_seqno = 0; generate_new_host_cpid(); @@ -1123,13 +1130,16 @@ void CLIENT_STATE::scale_duration_correction_factors(double factor) { } // Choose a new host CPID. -// Do scheduler RPCs to all projects to propagate the CPID +// If using account manager, +// do scheduler RPCs to all projects to propagate the CPID // void CLIENT_STATE::generate_new_host_cpid() { host_info.generate_host_cpid(); - for (unsigned int i=0; isched_rpc_pending = true; - projects[i]->min_rpc_time = now + 15; + if (strlen(acct_mgr_info.acct_mgr_url)) { + for (unsigned int i=0; isched_rpc_pending = true; + projects[i]->min_rpc_time = now + 15; + } } }