summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2022-04-15 10:56:05 +0000
committerRuediger Pluem <rpluem@apache.org>2022-04-15 10:56:05 +0000
commita1941f8012b6b25de581e7da91f95e6f2e77eff6 (patch)
tree2921f2ae2ccb8a31274d1399c049d5609246b235 /server
parent64dfe45db61356a25d86f37c3dcf562070e78d2b (diff)
downloadhttpd-a1941f8012b6b25de581e7da91f95e6f2e77eff6.tar.gz
* Port r1899858, r1899865 to worker MPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899884 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/mpm/worker/worker.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c
index 9f05dbb819..1743b14f9a 100644
--- a/server/mpm/worker/worker.c
+++ b/server/mpm/worker/worker.c
@@ -1603,6 +1603,7 @@ static void perform_idle_server_maintenance(int child_bucket)
static void server_main_loop(int remaining_children_to_start)
{
int num_buckets = retained->mpm->num_buckets;
+ int successive_kills = 0;
ap_generation_t old_gen;
int child_slot;
apr_exit_why_e exitwhy;
@@ -1697,11 +1698,30 @@ static void server_main_loop(int remaining_children_to_start)
/* Don't perform idle maintenance when a child dies,
* only do it when there's a timeout. Remember only a
* finite number of children can die, and it's pretty
- * pathological for a lot to die suddenly.
+ * pathological for a lot to die suddenly. If a child is
+ * killed by a signal (faulting) we want to restart it ASAP
+ * though, up to 3 successive faults or we stop this until
+ * a timeout happens again (to avoid the flood of fork()ed
+ * processes that keep being killed early).
*/
- continue;
+ if (child_slot < 0 || !APR_PROC_CHECK_SIGNALED(exitwhy)) {
+ continue;
+ }
+ if (++successive_kills >= 3) {
+ if (successive_kills % 10 == 3) {
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0,
+ ap_server_conf, APLOGNO(10392)
+ "children are killed successively!");
+ }
+ continue;
+ }
+ ++remaining_children_to_start;
+ }
+ else {
+ successive_kills = 0;
}
- else if (remaining_children_to_start) {
+
+ if (remaining_children_to_start) {
/* we hit a 1 second timeout in which none of the previous
* generation of children needed to be reaped... so assume
* they're all done, and pick up the slack if any is left.