Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Dev

[PATCH] Bug 48735 - bybusyness does not balance after failed worker has recovered

 

 

Apache dev RSS feed   Index | Next | Previous | View Threaded


trawick at gmail

Jul 26, 2012, 4:38 PM

Post #1 of 2 (134 views)
Permalink
[PATCH] Bug 48735 - bybusyness does not balance after failed worker has recovered

The primary issue is that the busy flag is incremented when the worker
is chosen but, if an error is encountered and another worker selected,
the flag is never decremented. (The sole decrement in
proxy_balancer_post_request() will be of the worker used to
successfully process the request.)

One of the 2.2.x patches attached to 48735 resets busy and lbstatus to
0 when a worker is recovered. But it seems rather non-intuitive to
remain busy while in error state.

My alternative for handling the busy flag is to register a request
cleanup at the time the busy flag is incremented to ensure that it is
decremented, no matter what happens on the request.

Index: modules/proxy/mod_proxy_balancer.c
===================================================================
--- modules/proxy/mod_proxy_balancer.c (revision 1366162)
+++ modules/proxy/mod_proxy_balancer.c (working copy)
@@ -437,6 +437,17 @@
}
}

+static apr_status_t decrement_busy_count(void *worker_)
+{
+ proxy_worker *worker = worker_;
+
+ if (worker->s->busy) {
+ worker->s->busy--;
+ }
+
+ return APR_SUCCESS;
+}
+
static int proxy_balancer_pre_request(proxy_worker **worker,
proxy_balancer **balancer,
request_rec *r,
@@ -570,6 +581,8 @@
}

(*worker)->s->busy++;
+ apr_pool_cleanup_register(r->pool, *worker, decrement_busy_count,
+ apr_pool_cleanup_null);

/* Add balancer/worker info to env. */
apr_table_setn(r->subprocess_env,
@@ -642,11 +655,7 @@
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01176)
"proxy_balancer_post_request for (%s)", balancer->s->name);

- if (worker && worker->s->busy)
- worker->s->busy--;
-
return OK;
-
}

static void recalc_factors(proxy_balancer *balancer)

thoughts?

concern:

* lbstatus: I haven't learned how lbstatus is manipulated or checked
when/what should be done for a recovered worker; once busy is handled
there's still some bogosity with the "load" as displayed by balancer
manager, so something is needed here

--
Born in Roswell... married an alien...
http://emptyhammock.com/


jim at jaguNET

Jul 27, 2012, 6:11 AM

Post #2 of 2 (131 views)
Permalink
Re: [PATCH] Bug 48735 - bybusyness does not balance after failed worker has recovered [In reply to]

On Jul 26, 2012, at 7:38 PM, Jeff Trawick wrote:
>
> thoughts?
>

++1!

Apache dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.