ASF Bugzilla – Attachment 32343 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.patch2 (text/plain), 4.28 KB, created by
Yann Ylavic
on 2015-01-05 15:44:22 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:44:22 UTC
Size:
4.28 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(); > } >@@ -1404,6 +1406,8 @@ static const char * > const char *err = ap_proxy_add_worker(&worker, cmd->pool, conf, r); > if (err) > return apr_pstrcat(cmd->temp_pool, "ProxyPass ", err, NULL); >+ /* Ignore (disable-on-)errors for non balancer-members */ >+ worker->status |= PROXY_WORKER_IGNORE_ERRORS; > } else { > ap_log_error(APLOG_MARK, APLOG_INFO, 0, cmd->server, > "worker %s already used by another worker", worker->name); >@@ -1906,6 +1910,8 @@ static const char * > if (err) > return apr_pstrcat(cmd->temp_pool, "ProxySet ", > err, NULL); >+ /* Ignore (disable-on-)errors for non balancer-members */ >+ worker->status |= PROXY_WORKER_IGNORE_ERRORS; > } > else > return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '", >@@ -2051,6 +2057,8 @@ static const char *proxysection(cmd_parms *cmd, vo > if (err) > return apr_pstrcat(cmd->temp_pool, thiscmd->name, > " ", err, NULL); >+ /* Ignore (disable-on-)errors for non balancer-members */ >+ worker->status |= PROXY_WORKER_IGNORE_ERRORS; > } > } > if (worker == NULL && balancer == NULL) {
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