* 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
Committed by: rpluem
Reviewed by: rpluem, covener, sf
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1307835 13f79535-47bb-0310-9956-
ffa450edef68
envvars: Fix insecure handling of LD_LIBRARY_PATH that could lead to the
current working directory to be searched for DSOs. [Stefan Fritsch]
+ *) mod_proxy: Add the forcerecovery balancer parameter that determines if
+ recovery for balancer workers is enforced. [Ruediger Pluem]
+
*) Fix MPM DSO load failure on AIX. [Jeff Trawick]
*) mod_proxy: Correctly set up reverse proxy worker. PR 52935.
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_proxy: Add the forcerecovery balancer parameter that determines if
- recovery for balancer workers is enforced.
- Trunk version of patch:
- http://svn.apache.org/viewvc?rev=1306409&view=rev
- Backport version for 2.2.x of patch:
- http://people.apache.org/~rpluem/patches/forcerecovery_2.4.diff
- +1: rpluem, covener, sf
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
<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.4.1-dev) Change re_nsub in ap_regex_t from apr_size_t to int.
* 20120211.1 (2.4.2-dev) Add AP_HAVE_C99
* 20120211.2 (2.4.2-dev) Add ap_runtime_dir_relative
+ * 20120211.3 (2.4.2-dev) Add forcerecovery to proxy_balancer_shared struct
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#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);