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
-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mod_proxy: Add the forcerecovery balancer parameter that determines if
+ recovery for balancer workers is enforced. [Ruediger Pluem]
+
*) mod_proxy: Correctly set up reverse proxy worker. PR 52935.
[Petter Berntsen <petterb gmail.com>]
<td>Number of additional BalancerMembers to allow to be added
to this balancer in addition to those defined at configuration.
</td></tr>
+ <tr><td>forcerecovery</td>
+ <td>On</td>
+ <td>Force the immediate recovery of all workers without considering the
+ retry parameter of the workers if all workers of a balancer are
+ in error state. 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. In this case
+ set to <code>Off</code>.
+ </td></tr>
</table>
<p>A sample balancer setup</p>
* 20120211.0 (2.5.0-dev) Change re_nsub in ap_regex_t from apr_size_t to int.
* 20120211.1 (2.5.0-dev) Add ap_palloc_debug, ap_pcalloc_debug
* 20120211.2 (2.5.0-dev) Add ap_runtime_dir_relative
+ * 20120211.3 (2.5.0-dev) Add forcerecovery to proxy_balancer_shared struct
*/
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20120211
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 3 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
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";
}
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)))
}
}
}
- if (!ok) {
+ if (!ok && balancer->s->forcerecovery) {
/* If all workers are in error state force the recovery.
*/
worker = (proxy_worker **)balancer->workers->elts;
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);