From: Jeff Trawick Date: Wed, 15 Aug 2012 11:37:29 +0000 (+0000) Subject: Merge a subset of r1363440 from trunk: X-Git-Tag: 2.2.23~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f39ab6624702676d73a65a9e893f21018381484e;p=thirdparty%2Fapache%2Fhttpd.git Merge a subset of r1363440 from trunk: mpm_worker: Fix cases where the spawn rate wasn't reduced after child process resource shortages. (Note: mpm_event is omitted from this backport proposal because of missing prerequisite fixes. Even mpm_worker has a tiny issue, described in comments in the code.) Submitted by: trawick Reviewed by: rjung, rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1373342 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 03a5084cc8a..ad14c507289 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ Changes with Apache 2.2.23 envvars: Fix insecure handling of LD_LIBRARY_PATH that could lead to the current working directory to be searched for DSOs. [Stefan Fritsch] + *) mpm_worker: Fix cases where the spawn rate wasn't reduced after child + process resource shortages. [Jeff Trawick] + *) mpm_prefork: Reduce spawn rate after a child process exits due to unexpected poll or accept failure. [Jeff Trawick] diff --git a/STATUS b/STATUS index 69304fbb3cc..73cc527395a 100644 --- a/STATUS +++ b/STATUS @@ -118,15 +118,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: 2.2.x patch: http://people.apache.org/~jim/patches/mod_proxy_ajp-erroroverride.patch +1: igalic, jim, rpluem - * mpm_worker: Fix cases where the spawn rate wasn't reduced after - child process resource shortages. - (Note: mpm_event is omitted from this backport proposal because of - missing prerequisite fixes. Even mpm_worker has a tiny issue, - described in the patch.) - trunk patch: http://svn.apache.org/viewvc?view=rev&rev=1363440 - 2.2.x patch: http://people.apache.org/~trawick/r1363440-worker-only-2.2.x.txt - +1: trawick, rjung, rpluem - * mod_proxy_balancer: Restore balancing after a failed worker has recovered when using lbmethod_bybusyness. PR 48735. trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1366344 diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index 11c7d89cdee..f13f639426f 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -1623,6 +1623,15 @@ static void server_main_loop(int remaining_children_to_start) } else if (ap_unregister_extra_mpm_process(pid.pid) == 1) { /* handled */ + if (processed_status == APEXIT_CHILDSICK) { + /* resource shortage, minimize the fork rate */ + /* 2.2.x note: Unlike 2.4+, there's no way to verify that + * this child was part of the current generation, so we + * can't leave the spawn rate alone for sick children of + * previous generations. + */ + idle_spawn_rate = 1; + } #if APR_HAS_OTHER_CHILD } else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH,