You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2012/08/15 13:37:29 UTC

svn commit: r1373342 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS server/mpm/worker/worker.c

Author: trawick
Date: Wed Aug 15 11:37:29 2012
New Revision: 1373342

URL: http://svn.apache.org/viewvc?rev=1373342&view=rev
Log:
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

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/server/mpm/worker/worker.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=1373342&r1=1373341&r2=1373342&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Wed Aug 15 11:37:29 2012
@@ -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]
 

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=1373342&r1=1373341&r2=1373342&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Wed Aug 15 11:37:29 2012
@@ -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

Modified: httpd/httpd/branches/2.2.x/server/mpm/worker/worker.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/mpm/worker/worker.c?rev=1373342&r1=1373341&r2=1373342&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/mpm/worker/worker.c (original)
+++ httpd/httpd/branches/2.2.x/server/mpm/worker/worker.c Wed Aug 15 11:37:29 2012
@@ -1623,6 +1623,15 @@ static void server_main_loop(int remaini
             }
             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,