]> granicus.if.org Git - apache/commitdiff
* Set the new environment variable BALANCER_ROUTE_CHANGED if a worker with a
authorRuediger Pluem <rpluem@apache.org>
Sat, 16 Sep 2006 19:49:41 +0000 (19:49 +0000)
committerRuediger Pluem <rpluem@apache.org>
Sat, 16 Sep 2006 19:49:41 +0000 (19:49 +0000)
  route different from the one supplied by the client had been chosen or if
  the client supplied no routing information for a balancer with sticky
  sessions.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@446929 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/mod_proxy_balancer.c

diff --git a/CHANGES b/CHANGES
index 29ade03689ddb1c71593eb3df6d84694149e1235..4f10cdb39c77ce469ea568b9494780e5bc8c0591 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,11 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) mod_proxy_balancer: Set the new environment variable BALANCER_ROUTE_CHANGED
+     if a worker with a route different from the one supplied by the client
+     had been chosen or if the client supplied no routing information for
+     a balancer with sticky sessions. [Ruediger Pluem]
+
   *) mod_proxy: Print the correct error message for erroneous configured
      ProxyPass directives. PR 40439. [serai lans-tv.com]
 
index 9572565336813d48f3b6a041fa4309d4b6b63f4d..8870a4a72b140867ea70612e72a46212d47469ea 100644 (file)
@@ -267,6 +267,16 @@ static proxy_worker *find_session_route(proxy_balancer *balancer,
          * Find the worker that has this route defined.
          */
         worker = find_route_worker(balancer, *route, r);
+        if (worker && strcmp(*route, worker->s->route)) {
+            /*
+             * Notice that the route of the worker chosen is different from
+             * the route supplied by the client.
+             */
+            apr_table_setn(r->subprocess_env, "BALANCER_ROUTE_CHANGED", "1");
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+                         "proxy: BALANCER: Route changed from %s to %s",
+                         *route, worker->s->route);
+        }
         return worker;
     }
     else
@@ -424,6 +434,17 @@ static int proxy_balancer_pre_request(proxy_worker **worker,
 
             return HTTP_SERVICE_UNAVAILABLE;
         }
+        if ((*balancer)->sticky && runtime) {
+            /*
+             * This balancer has sticky sessions and the client either has not
+             * supplied any routing information or all workers for this route
+             * including possible redirect and hotstandby workers are in error
+             * state, but we have found another working worker for this
+             * balancer where we can send the request. Thus notice that we have
+             * changed the route to the backend.
+             */
+            apr_table_setn(r->subprocess_env, "BALANCER_ROUTE_CHANGED", "1");
+        }
         *worker = runtime;
     }