diff options
author | Ruediger Pluem <rpluem@apache.org> | 2012-03-28 17:22:40 +0200 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2012-03-28 17:22:40 +0200 |
commit | e948002f960d31bf85bdba3c37712a2ace5ba626 (patch) | |
tree | 91b6fa8c7374ffd0a475be6ecf8e5a72fbda54f4 /modules | |
parent | Adapt Timeout to be the same as DEFAULT_TIMEOUT. (diff) | |
download | apache2-e948002f960d31bf85bdba3c37712a2ace5ba626.tar.xz apache2-e948002f960d31bf85bdba3c37712a2ace5ba626.zip |
* Add the forcerecovery balancer parameter that determines if recovery for
balancer workers without considering the retry value of workers is enforced.
There might be cases where an already overloaded backend can get into deeper
trouble if the recovery of all workers is enforced without considering the
retry parameter of each worker
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1306409 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r-- | modules/proxy/mod_proxy.c | 8 | ||||
-rw-r--r-- | modules/proxy/mod_proxy.h | 1 | ||||
-rw-r--r-- | modules/proxy/mod_proxy_balancer.c | 2 | ||||
-rw-r--r-- | modules/proxy/proxy_util.c | 2 |
4 files changed, 12 insertions, 1 deletions
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 8d289552d3..f9a800907a 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -387,6 +387,14 @@ static const char *set_balancer_param(proxy_server_conf *conf, return "growth must be between 1 and 100"; balancer->growth = ival; } + else if (!strcasecmp(key, "forcerecovery")) { + if (!strcasecmp(val, "on")) + balancer->s->forcerecovery = 1; + else if (!strcasecmp(val, "off")) + balancer->s->forcerecovery = 0; + else + return "forcerecovery must be On|Off"; + } else { return "unknown Balancer parameter"; } diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index 5348d02a1f..5ad91fb595 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -424,6 +424,7 @@ typedef struct { unsigned int need_reset:1; unsigned int vhosted:1; unsigned int inactive:1; + unsigned int forcerecovery:1; } proxy_balancer_shared; #define ALIGNED_PROXY_BALANCER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_balancer_shared))) diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index 28eb176884..e3db4883f1 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -423,7 +423,7 @@ static void force_recovery(proxy_balancer *balancer, server_rec *s) } } } - if (!ok) { + if (!ok && balancer->s->forcerecovery) { /* If all workers are in error state force the recovery. */ worker = (proxy_worker **)balancer->workers->elts; diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 5821aa9300..fe2ac43e20 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1164,6 +1164,8 @@ PROXY_DECLARE(char *) ap_proxy_define_balancer(apr_pool_t *p, bshared->hash.fnv = ap_proxy_hashfunc(bshared->name, PROXY_HASHFUNC_FNV); (*balancer)->hash = bshared->hash; + bshared->forcerecovery = 1; + /* Retrieve a UUID and store the nonce for the lifetime of * the process. */ apr_uuid_get(&uuid); |