On 09/02/2007 04:57 PM, Vinicius Petrucci wrote:
> Hi Guys,
> 
> I've read Ruediger's patch about preventing mod_proxy_balancer from
> overwriting the status of workers when creating a new child process
> (http://svn.apache.org/viewcvs?rev=374929&view=rev).
> 
> I'm running the latest stable release of Apache (2.2.4) and I think
> the same bug is overwriting the lbfactor value to 1 (original
> configuration) when creating a new child process. Is it really a bug?
> How can I prevent that?

Can you please try if the attached patch against trunk fixes your issue
(also applies for 2.2.x with little fuzz)?
Can you please open a bug report in bugzilla for this? This eases tracking
for us. Thanks.

I CCed dev@httpd.apache.org as this is the correct mailing list for
such issues (apart from bugzilla as mentioned above).

Regards

Rüdiger


Index: modules/proxy/mod_proxy_balancer.c
===================================================================
--- modules/proxy/mod_proxy_balancer.c	(revision 572243)
+++ modules/proxy/mod_proxy_balancer.c	(working copy)
@@ -86,22 +86,23 @@
 {
     int i;
     proxy_worker *workers;
+    int worker_is_initialized;
 
     workers = (proxy_worker *)balancer->workers->elts;
 
     for (i = 0; i < balancer->workers->nelts; i++) {
+        worker_is_initialized = PROXY_WORKER_IS_INITIALIZED(workers);
         ap_proxy_initialize_worker_share(conf, workers, s);
         ap_proxy_initialize_worker(workers, s);
+        if (!worker_is_initialized) {
+            /* Set to the original configuration */
+            workers[i].s->lbstatus = workers[i].s->lbfactor =
+            (workers[i].lbfactor ? workers[i].lbfactor : 1);
+            workers[i].s->lbset = workers[i].lbset;
+        }
         ++workers;
     }
 
-    workers = (proxy_worker *)balancer->workers->elts;
-    for (i = 0; i < balancer->workers->nelts; i++) {
-        /* Set to the original configuration */
-        workers[i].s->lbstatus = workers[i].s->lbfactor =
-          (workers[i].lbfactor ? workers[i].lbfactor : 1);
-        workers[i].s->lbset = workers[i].lbset;
-    }
     /* Set default number of attempts to the number of
      * workers.
      */

Reply via email to