fix rpc_seqno bug (client fix)

svn path=/trunk/boinc/; revision=9596
This commit is contained in:
David Anderson 2006-03-03 20:22:25 +00:00
parent 1bc3701338
commit 46da850166
2 changed files with 26 additions and 4 deletions

View File

@ -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

View File

@ -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; i<projects.size(); i++) {
projects[i]->sched_rpc_pending = true;
projects[i]->min_rpc_time = now + 15;
if (strlen(acct_mgr_info.acct_mgr_url)) {
for (unsigned int i=0; i<projects.size(); i++) {
projects[i]->sched_rpc_pending = true;
projects[i]->min_rpc_time = now + 15;
}
}
}