From 70f1ffeb22e32f6e3a350fecdb9ff231e1f4de0b Mon Sep 17 00:00:00 2001 From: Hamid Aghdaee Date: Sat, 16 Nov 2002 00:36:31 +0000 Subject: [PATCH] forgot a couple of files. svn path=/trunk/boinc/; revision=625 --- client/cs_scheduler.C | 2 ++ client/scheduler_op.C | 24 +++++++++++++++++------- client/scheduler_op.h | 6 +++--- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 21d7eea8ce..e34691f1be 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -110,6 +110,8 @@ PROJECT* CLIENT_STATE::next_project(PROJECT* old) { pbest = 0; for (i=0; imaster_url_fetch_pending) + continue; if (p->min_rpc_time > now ) continue; if (old && p->debt_order <= old->debt_order) continue; if (p->debt_order < best) { diff --git a/client/scheduler_op.C b/client/scheduler_op.C index dadcea3eb1..a24192095c 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -47,10 +47,17 @@ int SCHEDULER_OP::init_get_work() { if( (retval=init_op_project(ns)) ) { sprintf(err_msg, "init_get_work failed, error %d\n", retval); backoff(project, err_msg); - - return retval; + return retval; } } + else + { + project = gstate.next_project_master_pending(); + if (project) { + init_master_fetch(project); + } + } + return 0; } @@ -295,11 +302,13 @@ bool SCHEDULER_OP::poll() { backoff(project,""); if ((project->nrpc_failures % MASTER_FETCH_PERIOD) == 0) { project->master_url_fetch_pending = true; - } + project->min_rpc_time = 0; + project->nrpc_failures = 0; + } if (must_get_work) { project = gstate.next_project(project); if (project) { - if( (retval=init_op_project(gstate.work_needed_secs())) ) { + if( (retval=init_op_project(gstate.work_needed_secs())) ) { sprintf( err_msg, "scheduler init_op_project to %s failed, error %d\n", project->scheduler_urls[url_index].text, retval @@ -309,7 +318,8 @@ bool SCHEDULER_OP::poll() { } else { scheduler_op_done = true; } - } else { + } + else { scheduler_op_done = true; } } @@ -348,9 +358,9 @@ bool SCHEDULER_OP::poll() { if (scheduler_op_done) { project = gstate.next_project_master_pending(); if (project) { - init_master_fetch(project); + init_master_fetch(project); } else { - state = SCHEDULER_OP_STATE_IDLE; + state = SCHEDULER_OP_STATE_IDLE; if (log_flags.sched_op_debug) { printf("Scheduler_op: return to idle state\n"); } diff --git a/client/scheduler_op.h b/client/scheduler_op.h index e0c767c374..b9421d6034 100644 --- a/client/scheduler_op.h +++ b/client/scheduler_op.h @@ -36,11 +36,11 @@ // constants related to scheduler RPC policy -#define MASTER_FETCH_PERIOD 10 +#define MASTER_FETCH_PERIOD 5 // fetch and parse master URL if nrpc_failures is a multiple of this -#define RETRY_BASE_PERIOD 100 +#define RETRY_BASE_PERIOD 1 // after failure, back off 2^nrpc_failures times this times random -#define RETRY_CAP 10 +#define RETRY_CAP 5 // cap on nrpc_failures in the above formula #define SCHEDULER_OP_STATE_IDLE 0