ASF Bugzilla – Attachment 32342 Details for
Bug 48388
mod proxy disabling workers after a single error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Don't put normal (non balancer-member) workers in error (2.2.x)
httpd-2.2.x-proxy_worker_ignore_errors.patch (text/plain), 3.36 KB, created by
Yann Ylavic
on 2015-01-05 15:33:11 UTC
(
hide
)
Description:
Don't put normal (non balancer-member) workers in error (2.2.x)
Filename:
MIME Type:
Creator:
Yann Ylavic
Created:
2015-01-05 15:33:11 UTC
Size:
3.36 KB
patch
obsolete
>Index: modules/proxy/mod_proxy_balancer.c >=================================================================== >--- modules/proxy/mod_proxy_balancer.c (revision 1649544) >+++ modules/proxy/mod_proxy_balancer.c (working copy) >@@ -612,7 +612,8 @@ static int proxy_balancer_post_request(proxy_worke > balancer->name); > return HTTP_INTERNAL_SERVER_ERROR; > } >- if (!apr_is_empty_array(balancer->errstatuses)) { >+ if (!apr_is_empty_array(balancer->errstatuses) >+ && !(worker->s->status & PROXY_WORKER_IGNORE_ERRORS)) { > int i; > for (i = 0; i < balancer->errstatuses->nelts; i++) { > int val = ((int *)balancer->errstatuses->elts)[i]; >@@ -630,6 +631,7 @@ static int proxy_balancer_post_request(proxy_worke > } > > if (balancer->failontimeout >+ && !(worker->s->status & PROXY_WORKER_IGNORE_ERRORS) > && (apr_table_get(r->notes, "proxy_timedout")) != NULL) { > ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, > "%s: Forcing worker (%s) into error state " >Index: modules/proxy/proxy_util.c >=================================================================== >--- modules/proxy/proxy_util.c (revision 1649544) >+++ modules/proxy/proxy_util.c (working copy) >@@ -1960,7 +1960,8 @@ PROXY_DECLARE(int) ap_proxy_retry_worker(const cha > ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, > "proxy: %s: retrying the worker for (%s)", > proxy_function, worker->hostname); >- if (apr_time_now() > worker->s->error_time + worker->retry) { >+ if ((worker->s->status & PROXY_WORKER_IGNORE_ERRORS) >+ || apr_time_now() > worker->s->error_time + worker->retry) { > ++worker->s->retries; > worker->s->status &= ~PROXY_WORKER_IN_ERROR; > ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, >Index: modules/proxy/mod_proxy.c >=================================================================== >--- modules/proxy/mod_proxy.c (revision 1649544) >+++ modules/proxy/mod_proxy.c (working copy) >@@ -1045,7 +1045,8 @@ static int proxy_handler(request_rec *r) > * We can not failover to another worker. > * Mark the worker as unusable if member of load balancer > */ >- if (balancer) { >+ if (balancer >+ && !(worker->s->status & PROXY_WORKER_IGNORE_ERRORS)) { > worker->s->status |= PROXY_WORKER_IN_ERROR; > worker->s->error_time = apr_time_now(); > } >@@ -1056,7 +1057,8 @@ static int proxy_handler(request_rec *r) > * We can failover to another worker > * Mark the worker as unusable if member of load balancer > */ >- if (balancer) { >+ if (balancer >+ && !(worker->s->status & PROXY_WORKER_IGNORE_ERRORS)) { > worker->s->status |= PROXY_WORKER_IN_ERROR; > worker->s->error_time = apr_time_now(); > } >@@ -2311,6 +2313,8 @@ static void child_init(apr_pool_t *p, server_rec * > for (i = 0; i < conf->workers->nelts; i++) { > ap_proxy_initialize_worker_share(conf, worker, s); > ap_proxy_initialize_worker(worker, s); >+ /* Disabling worker on errors is for balancer members only */ >+ worker->s->status |= PROXY_WORKER_IGNORE_ERRORS; > worker++; > } > /* Initialize forward worker if defined */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48388
:
24706
|
32341
|
32342
|
32343