httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r446929 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_balancer.c
Date Sat, 16 Sep 2006 19:49:41 GMT
Author: rpluem
Date: Sat Sep 16 12:49:41 2006
New Revision: 446929

URL: http://svn.apache.org/viewvc?view=rev&rev=446929
Log:
* 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.

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?view=diff&rev=446929&r1=446928&r2=446929
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Sep 16 12:49:41 2006
@@ -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]
 

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?view=diff&rev=446929&r1=446928&r2=446929
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Sat Sep 16 12:49:41 2006
@@ -267,6 +267,16 @@
          * 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
@@ -423,6 +433,17 @@
                          (*balancer)->name);
 
             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;
     }



Mime
View raw message