httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r417443 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_balancer.c
Date Tue, 27 Jun 2006 12:05:43 GMT
Author: rpluem
Date: Tue Jun 27 05:05:43 2006
New Revision: 417443

URL: http://svn.apache.org/viewvc?rev=417443&view=rev
Log:
* Retry worker chosen by client supplied route / redirect worker if it
  is in error state before sending "Service Temporarily Unavailable".

PR: 38962
Submitted by: Christian Boitel <cboitel lfdj.com>
Reviewed by: rpluem

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=417443&r1=417442&r2=417443&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Jun 27 05:05:43 2006
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) mod_proxy_balancer: Retry worker chosen by route / redirect worker if
+     it is in error state before sending "Service Temporarily Unavailable".
+     PR 38962. [Christian Boitel <cboitel lfdj.com>]
+
   *) mod_proxy_balancer: Add information about the route, the sticky session
      and the worker used during a request as environment variables. PR 39806.
      [Brian <brectanu gmail.com>]

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?rev=417443&r1=417442&r2=417443&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Tue Jun 27 05:05:43 2006
@@ -219,18 +219,39 @@
          */
         worker = find_route_worker(balancer, *route);
         if (worker && !PROXY_WORKER_IS_USABLE(worker)) {
-            /* We have a worker that is unusable.
-             * It can be in error or disabled, but in case
-             * it has a redirection set use that redirection worker.
-             * This enables to safely remove the member from the
-             * balancer. Of course you will need a some kind of
-             * session replication between those two remote.
+            /*
+             * If the worker is in error state run
+             * retry on that worker. It will be marked as
+             * operational if the retry timeout is elapsed.
+             * The worker might still be unusable, but we try
+             * anyway.
              */
-            if (*worker->s->redirect)
-                worker = find_route_worker(balancer, worker->s->redirect);
-            /* Check if the redirect worker is usable */
-            if (worker && !PROXY_WORKER_IS_USABLE(worker))
-                worker = NULL;
+            ap_proxy_retry_worker("BALANCER", worker, r->server);
+            if (!PROXY_WORKER_IS_USABLE(worker)) {
+                /*
+                 * We have a worker that is unusable.
+                 * It can be in error or disabled, but in case
+                 * it has a redirection set use that redirection worker.
+                 * This enables to safely remove the member from the
+                 * balancer. Of course you will need some kind of
+                 * session replication between those two remote.
+                 */
+                if (*worker->s->redirect)
+                    worker = find_route_worker(balancer, worker->s->redirect);
+                /* Check if the redirect worker is usable */
+                if (worker && !PROXY_WORKER_IS_USABLE(worker)) {
+                    /*
+                     * If the worker is in error state run
+                     * retry on that worker. It will be marked as
+                     * operational if the retry timeout is elapsed.
+                     * The worker might still be unusable, but we try
+                     * anyway.
+                     */
+                    ap_proxy_retry_worker("BALANCER", worker, r->server);
+                    if (!PROXY_WORKER_IS_USABLE(worker))
+                        worker = NULL;
+                }
+            }
         }
         return worker;
     }



Mime
View raw message