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, 23 Sep 2005 07:18:21 GMT
mturk       2005/09/23 00:18:21

  Modified:    jk/native/common jk_lb_worker.c
  Log:
  Fix loadbalancer retries to allow usage of cachesize lower then
  number of threads. In case the worker is busy having no free endpoints,
  and the retries config value is larger the total number of workers in load
  balancer, for each consequitive attempt sleep for a 100 ms, rather then
  returning 503.
  
  Revision  Changes    Path
  1.95      +11 -10    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.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- jk_lb_worker.c	16 Sep 2005 05:52:26 -0000	1.94
  +++ jk_lb_worker.c	23 Sep 2005 07:18:21 -0000	1.95
  @@ -595,7 +595,7 @@
   
           while (num_of_workers) {
               worker_record_t *rec =
  -                get_most_suitable_worker(p->worker, s, attempt++, l);
  +                get_most_suitable_worker(p->worker, s, attempt, l);
               int rc;
               /* Do not reuse previous worker, because
                * that worker already failed.
  @@ -650,20 +650,21 @@
                   else {
                       /* If we can not get the endpoint
                        * mark the worker as busy rather then
  -                     * as in error
  +                     * as in error if the attemp number is
  +                     * greater then the number of retries.
                        */
  -                    if (p->worker->s->retries < num_of_workers)
  +                    attempt++;
  +                    if (attempt > p->worker->s->retries) {
                           rec->s->is_busy = JK_TRUE;
  +                        num_of_workers = 0;
  +                    }
                       jk_log(l, JK_LOG_INFO,
                              "could not get free endpoint for worker %s (attempt %d)",
                              rec->s->name, attempt);
  -                    /* Decrement the worker count and try another worker */
  -                    if (attempt > p->worker->s->retries)
  -                        num_of_workers = 0;
  -                    /* In case of retries > 3 sleep 100 ms
  -                     * on each next attempt.
  +                    /* In case of attempt > num of workers sleep for 100 ms
  +                     * on each consequtive attempt.
                        */
  -                    else if (attempt > JK_RETRIES)
  +                    if (attempt > p->worker->num_of_workers)
                           jk_sleep_def();    
                       continue;
                   }
  
  
  

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