From: Jim Jagielski Date: Thu, 10 Feb 2011 15:29:07 +0000 (+0000) Subject: *) prefork: Update MPM state in children during a graceful restart. X-Git-Tag: 2.2.18~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42200b46804b0115daa9a23441251f77a26a334d;p=thirdparty%2Fapache%2Fhttpd.git *) prefork: Update MPM state in children during a graceful restart. Allow the HTTP connection handling loop to terminate early during a graceful restart. PR 41743. [Andrew Punch ] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1069428 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index dc2bb374808..cb8fa910b7e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,12 +1,22 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.18 + *) prefork: Update MPM state in children during a graceful restart. + Allow the HTTP connection handling loop to terminate early + during a graceful restart. PR 41743. + [Andrew Punch ] + *) mod_ssl: Correctly read full lines in input filter when the line is incomplete during first read. PR 50481. [Ruediger Pluem] *) mod_autoindex: Merge IndexOptions from server to directory context when the directory has no mod_autoindex directives. PR 47766. [Eric Covener] + *) prefork: Update MPM state in children during a graceful restart. + Allow the HTTP connection handling loop to terminate early + during a graceful restart. PR 41743. + [Andrew Punch ] + *) mod_cache: Make sure that we never allow a 304 Not Modified response that we asked for to leak to the client should the 304 response be uncacheable. PR45341 [Graham Leggett] diff --git a/STATUS b/STATUS index 17fa73215d7..a4f84834341 100644 --- a/STATUS +++ b/STATUS @@ -90,11 +90,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * prefork: Update MPM state in children; implement fast exit from - connection loop via ap_graceful_stop_signalled. PR 41743. - Trunk patch: http://svn.apache.org/viewvc?rev=1068389&view=rev - 2.2.x patch: https://issues.apache.org/bugzilla/attachment.cgi?id=26623 - +1: jorton, rpluem, jim PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index f5a72057bc7..108f961ae29 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -330,6 +330,7 @@ static void just_die(int sig) static void stop_listening(int sig) { + mpm_state = AP_MPMQ_STOPPING; ap_close_listeners(); /* For a graceful stop, we want the child to exit when done */ @@ -350,6 +351,7 @@ static void sig_term(int sig) */ return; } + mpm_state = AP_MPMQ_STOPPING; shutdown_pending = 1; is_graceful = (sig == AP_SIG_GRACEFUL_STOP); } @@ -363,6 +365,7 @@ static void restart(int sig) /* Probably not an error - don't bother reporting it */ return; } + mpm_state = AP_MPMQ_STOPPING; restart_pending = 1; is_graceful = (sig == AP_SIG_GRACEFUL); } @@ -458,8 +461,10 @@ static int num_listensocks = 0; int ap_graceful_stop_signalled(void) { - /* not ever called anymore... */ - return 0; + /* Return true if the server is stopping for whatever reason; the + * function is used to initiate a fast exit from the connection + * processing loop. */ + return mpm_state == AP_MPMQ_STOPPING; }