httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1170256 - in /httpd/httpd/trunk/modules/proxy: balancers/mod_lbmethod_bybusyness.c balancers/mod_lbmethod_byrequests.c balancers/mod_lbmethod_bytraffic.c examples/mod_lbmethod_rr.c mod_proxy.h
Date Tue, 13 Sep 2011 17:26:58 GMT
Author: jim
Date: Tue Sep 13 17:26:57 2011
New Revision: 1170256

URL: http://svn.apache.org/viewvc?rev=1170256&view=rev
Log:
Implement draining capability for proxy workers... only accept
sticky on these puppies.

Modified:
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c
    httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c?rev=1170256&r1=1170255&r2=1170256&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c Tue Sep 13 17:26:57
2011
@@ -52,12 +52,13 @@ static proxy_worker *find_best_bybusynes
                     if ((*worker)->s->lbset > max_lbset)
                         max_lbset = (*worker)->s->lbset;
                 }
-
-                if ((*worker)->s->lbset != cur_lbset)
-                    continue;
-
-                if ( (checking_standby ? !PROXY_WORKER_IS_STANDBY(*worker) : PROXY_WORKER_IS_STANDBY(*worker))
)
+                if (
+                    ((*worker)->s->lbset != cur_lbset) ||
+                    (checking_standby ? !PROXY_WORKER_IS_STANDBY(*worker) : PROXY_WORKER_IS_STANDBY(*worker))
||
+                    (PROXY_WORKER_IS_DRAINING(*worker))
+                    ) {
                     continue;
+                }
 
                 /* If the worker is in error state run
                  * retry on that worker. It will be marked as

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c?rev=1170256&r1=1170255&r2=1170256&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c Tue Sep 13 17:26:57
2011
@@ -94,10 +94,14 @@ static proxy_worker *find_best_byrequest
                     if ((*worker)->s->lbset > max_lbset)
                         max_lbset = (*worker)->s->lbset;
                 }
-                if ((*worker)->s->lbset != cur_lbset)
-                    continue;
-                if ( (checking_standby ? !PROXY_WORKER_IS_STANDBY(*worker) : PROXY_WORKER_IS_STANDBY(*worker))
)
+                if (
+                    ((*worker)->s->lbset != cur_lbset) ||
+                    (checking_standby ? !PROXY_WORKER_IS_STANDBY(*worker) : PROXY_WORKER_IS_STANDBY(*worker))
||
+                    (PROXY_WORKER_IS_DRAINING(*worker))
+                    ) {
                     continue;
+                }
+
                 /* If the worker is in error state run
                  * retry on that worker. It will be marked as
                  * operational if the retry timeout is elapsed.

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c?rev=1170256&r1=1170255&r2=1170256&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c Tue Sep 13 17:26:57
2011
@@ -66,10 +66,14 @@ static proxy_worker *find_best_bytraffic
                     if ((*worker)->s->lbset > max_lbset)
                         max_lbset = (*worker)->s->lbset;
                 }
-                if ((*worker)->s->lbset != cur_lbset)
-                    continue;
-                if ( (checking_standby ? !PROXY_WORKER_IS_STANDBY(*worker) : PROXY_WORKER_IS_STANDBY(*worker))
)
+                if (
+                    ((*worker)->s->lbset != cur_lbset) ||
+                    (checking_standby ? !PROXY_WORKER_IS_STANDBY(*worker) : PROXY_WORKER_IS_STANDBY(*worker))
||
+                    (PROXY_WORKER_IS_DRAINING(*worker))
+                    ) {
                     continue;
+                }
+
                 /* If the worker is in error state run
                  * retry on that worker. It will be marked as
                  * operational if the retry timeout is elapsed.

Modified: httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c?rev=1170256&r1=1170255&r2=1170256&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c (original)
+++ httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c Tue Sep 13 17:26:57 2011
@@ -75,8 +75,12 @@ static proxy_worker *find_best_roundrobi
         for (i = 0; i < balancer->workers->nelts; i++, worker++) {
             if (i < ctx->index)
                 continue;
-            if ( (checking_standby ? !PROXY_WORKER_IS_STANDBY(*worker) : PROXY_WORKER_IS_STANDBY(*worker))
)
+            if (
+                (checking_standby ? !PROXY_WORKER_IS_STANDBY(*worker) : PROXY_WORKER_IS_STANDBY(*worker))
||
+                (PROXY_WORKER_IS_DRAINING(*worker))
+                ) {
                 continue;
+            }
             if (!PROXY_WORKER_IS_USABLE(*worker))
                 ap_proxy_retry_worker("BALANCER", *worker, r->server);
             if (PROXY_WORKER_IS_USABLE(*worker)) {

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=1170256&r1=1170255&r2=1170256&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Tue Sep 13 17:26:57 2011
@@ -292,6 +292,8 @@ PROXY_WORKER_DISABLED | PROXY_WORKER_STO
 #define PROXY_WORKER_IS_USABLE(f)   ( ( !( (f)->s->status & PROXY_WORKER_NOT_USABLE_BITMAP)
) && \
   PROXY_WORKER_IS_INITIALIZED(f) )
 
+#define PROXY_WORKER_IS_DRAINING(f)   ( (f)->s->status &  PROXY_WORKER_DRAIN )
+
 /* default worker retry timeout in seconds */
 #define PROXY_WORKER_DEFAULT_RETRY    60
 



Mime
View raw message