httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r769020 - in /httpd/httpd/trunk/modules/proxy: balancers/mod_lbmethod_bybusyness.c balancers/mod_lbmethod_byrequests.c balancers/mod_lbmethod_bytraffic.c balancers/mod_lbmethod_heartbeat.c mod_proxy.h proxy_util.c
Date Mon, 27 Apr 2009 15:02:40 GMT
Author: jim
Date: Mon Apr 27 15:02:40 2009
New Revision: 769020

URL: http://svn.apache.org/viewvc?rev=769020&view=rev
Log:
Fold in initial template for methods to be able to
reset (initialize) and "age" their data, useful when
adding new workers, or when workers come back into
the fold....

Logic and code to come in a bit :)

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/balancers/mod_lbmethod_heartbeat.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h
    httpd/httpd/trunk/modules/proxy/proxy_util.c

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=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c Mon Apr 27 15:02:40
2009
@@ -105,10 +105,20 @@
 
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method bybusyness =
 {
     "bybusyness",
     &find_best_bybusyness,
+    &reset,
+    &age,
     NULL
 };
 

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=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c Mon Apr 27 15:02:40
2009
@@ -132,6 +132,14 @@
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 /*
  * How to add additional lbmethods:
  *   1. Create func which determines "best" candidate worker
@@ -142,6 +150,8 @@
 {
     "byrequests",
     &find_best_byrequests,
+    &reset,
+    &age,
     NULL
 };
 

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=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c Mon Apr 27 15:02:40
2009
@@ -105,10 +105,20 @@
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method bytraffic =
 {
     "bytraffic",
     &find_best_bytraffic,
+    &reset,
+    &age,
     NULL
 };
 

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c?rev=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c Mon Apr 27 15:02:40
2009
@@ -299,10 +299,20 @@
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method heartbeat =
 {
     "heartbeat",
     &find_best_hb,
+    &reset,
+    &age,
     NULL
 };
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Mon Apr 27 15:02:40 2009
@@ -390,6 +390,8 @@
     const char *name;            /* name of the load balancer method*/
     proxy_worker *(*finder)(proxy_balancer *balancer,
                             request_rec *r);
+    apr_status_t (*reset)(proxy_balancer *balancer, request_rec *r);
+    apr_status_t (*age)(proxy_balancer *balancer, request_rec *r);
     void            *context;   /* general purpose storage */
 };
 

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=769020&r1=769019&r2=769020&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Mon Apr 27 15:02:40 2009
@@ -2346,6 +2346,8 @@
             worker->hostname);
     }
     else {
+        if (worker->s->retries) {
+        }
         worker->s->error_time = 0;
         worker->s->retries = 0;
     }



Mime
View raw message