tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_lb_worker.c
Date Fri, 19 Nov 2004 15:30:44 GMT
mturk       2004/11/19 07:30:44

  Modified:    jk/native/common jk_lb_worker.c
  Log:
  Added configurable WAIT_BEFORE_RECOVER param.
  The new directive is named "recover_time" and can be customized
  inside workers.properies.
  
  Revision  Changes    Path
  1.31      +15 -4     jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c
  
  Index: jk_lb_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- jk_lb_worker.c	19 Nov 2004 12:58:18 -0000	1.30
  +++ jk_lb_worker.c	19 Nov 2004 15:30:44 -0000	1.31
  @@ -38,7 +38,7 @@
    * Time to wait before retry...
    */
   #define WAIT_BEFORE_RECOVER (60*1)
  -#define ADDITINAL_WAIT_LOAD (20)
  +#define WORKER_RECOVER_TIME ("recover_time")
   
   /** 
    * Worker record should be inside shared
  @@ -72,7 +72,9 @@
       int in_local_worker_mode;
       int local_worker_only;
       int sticky_session;
  +    int recover_wait_time;
   };
  +
   typedef struct lb_worker lb_worker_t;
   
   struct lb_endpoint
  @@ -244,7 +246,7 @@
                   if (!p->lb_workers[i].in_recovering) {
                       time_t now = time(0);
                       if ((now - p->lb_workers[i].error_time) >
  -                        WAIT_BEFORE_RECOVER) {
  +                        p->recover_wait_time) {
                           p->lb_workers[i].in_recovering = JK_TRUE;
                           p->lb_workers[i].error_time = now;
                           rc = &(p->lb_workers[i]);
  @@ -495,10 +497,19 @@
                             jk_map_t *props,
                             jk_worker_env_t *we, jk_logger_t *log)
   {
  +    int i;
   
       lb_worker_t *p = (lb_worker_t *)pThis->worker_private;
       pThis->retries = jk_get_worker_retries(props, p->name,
                                              JK_RETRIES);
  +
  +    if (jk_get_worker_int_prop(props, p->name,
  +                               WORKER_RECOVER_TIME,
  +                               &i))
  +        p->recover_wait_time = i;
  +    if (p->recover_wait_time < WAIT_BEFORE_RECOVER)
  +        p->recover_wait_time = WAIT_BEFORE_RECOVER;
  +
       return JK_TRUE;
   }
   
  @@ -571,7 +582,7 @@
           private_data->worker.get_endpoint = get_endpoint;
           private_data->worker.destroy = destroy;
           private_data->worker.retries = JK_RETRIES;
  -
  +        private_data->recover_wait_time = WAIT_BEFORE_RECOVER;
           *w = &private_data->worker;
           JK_TRACE_EXIT(l);
           return JK_TRUE;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message