]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mpm_{event,worker,prefork}: late stop of children processes on restart.
authorYann Ylavic <ylavic@apache.org>
Tue, 24 Aug 2021 22:22:40 +0000 (22:22 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 24 Aug 2021 22:22:40 +0000 (22:22 +0000)
commit243c5fad0a8da9a1008681ac60f5b981de6c18d6
treec1ab175d1fdfac1dfbeca0b3ce5e5dc5e50d77ee
parent9acfea84831efac669e2cd4cae519e0cae7e947f
mpm_{event,worker,prefork}: late stop of children processes on restart.

Change how the main process handles restarts, from:
    0. <restart signal>
    1. stop old generation of children processes (graceful or not)
    2. reload new configuration
    3. start new generation of children processes
to:
    0. <restart signal>
    1. reload new configuration
    2. stop old generation of children processes (graceful or not)
    3. start new generation of children processes

The delay between stop and start is now very short and does not depend on the
reload time (which can be quite long with many vhosts and/or complex setups
with regexps or whatever third party components to compile).

Also, while reloading, the old generation of children processes keeps accepting
and handling incoming connections until the new generation is up to take over.

* os/unix/unixd.c (sig_term, sig_restart):
  Set AP_MPMQ_STOPPING only once.

* server/listen.c (ap_duplicate_listeners):
  Use ap_log_error() the main server instead of ap_log_perror().

* server/mpm/{event,worker,prefork}/{event,worker,prefork}.c
    ({event,worker,prefork}_retained_data):
  Save the generation pool pointer (gen_pool) and all the buckets here, they
  won't be cleared before the reload like pconf so they need a persitent
  storage accross restarts (i.e. retained->gen_pool).

* server/mpm/{event,worker,prefork}/{event,worker,prefork}.c
    (perform_idle_server_maintenance, child_main, make_child):
  Change usage of all_buckets (previously with global/static scope) to the new
  retained->buckets array.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892587 13f79535-47bb-0310-9956-ffa450edef68
os/unix/unixd.c
server/listen.c
server/mpm/event/event.c
server/mpm/prefork/prefork.c
server/mpm/worker/worker.c