]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r417443 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 28 Aug 2006 16:32:09 +0000 (16:32 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 28 Aug 2006 16:32:09 +0000 (16:32 +0000)
* 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

Submitted by: rpluem
Reviewed by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@437745 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/mod_proxy_balancer.c

diff --git a/CHANGES b/CHANGES
index 54a17691508185d4ec545e3c1de8bb500a904206..122e19fc517acb2685c27b842f31c2d670c9b5c9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.4
 
-
+  *) 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>]
 
 Changes with Apache 2.2.3
 
index c506f48fe958581712a460b6c0c1e48c703607ff..1fb57db9d434ef3a2ed0a04c5354155bfaa1ad9a 100644 (file)
@@ -212,18 +212,39 @@ static proxy_worker *find_session_route(proxy_balancer *balancer,
          */
         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;
     }