httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: httpd-2.0/modules/proxy proxy_util.c mod_proxy.h
Date Fri, 17 Sep 2004 08:00:20 GMT
mturk       2004/09/17 01:00:20

  Modified:    modules/proxy proxy_util.c mod_proxy.h
  Log:
  Make worker retry algorithm much  simpler removing incremental
  timeout increase.
  
  Revision  Changes    Path
  1.156     +5 -12     httpd-2.0/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_util.c,v
  retrieving revision 1.155
  retrieving revision 1.156
  diff -u -r1.155 -r1.156
  --- proxy_util.c	15 Sep 2004 12:20:19 -0000	1.155
  +++ proxy_util.c	17 Sep 2004 08:00:20 -0000	1.156
  @@ -1429,6 +1429,9 @@
       }
       if (rv == APR_SUCCESS)
           worker->status |= PROXY_WORKER_INITIALIZED;
  +    /* Set default parameters */
  +    if (!worker->retry)
  +        worker->retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY);
       return rv;
   }
   
  @@ -1437,21 +1440,11 @@
                                            server_rec *s)
   {
       if (worker->status & PROXY_WORKER_IN_ERROR) {
  -        apr_interval_time_t diff;
  -        apr_time_t now = apr_time_now();
           ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
                       "proxy: %s: retrying the worker for (%s)",
                        proxy_function, worker->hostname);
  -        if (worker->retry)
  -            diff = worker->retry;
  -        else {
  -            /* Increase the time by 1 minute on each retry */
  -            diff = apr_time_from_sec((60 + 60 * worker->retries));
  -            /* Use 10 minutes as maximum value for retry */
  -            if (worker->retries < 8)
  -                ++worker->retries;
  -        }
  -        if (now > worker->error_time + diff) {
  +        if (apr_time_now() > worker->error_time + worker->retry) {
  +            ++worker->retries;
               worker->status &= ~PROXY_WORKER_IN_ERROR;
               ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
                            "proxy: %s: worker for (%s) has been marked for retry",
  
  
  
  1.136     +2 -0      httpd-2.0/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/mod_proxy.h,v
  retrieving revision 1.135
  retrieving revision 1.136
  diff -u -r1.135 -r1.136
  --- mod_proxy.h	16 Sep 2004 12:08:00 -0000	1.135
  +++ mod_proxy.h	17 Sep 2004 08:00:20 -0000	1.136
  @@ -231,6 +231,8 @@
   
   #define PROXY_WORKER_IS_USABLE(f)   (!((f)->status & 0x00F0))
   
  +/* default worker retry timeout in seconds */
  +#define PROXY_WORKER_DEFAULT_RETRY  60
   
   /* Worker configuration */
   struct proxy_worker {
  
  
  

Mime
View raw message