diff options
author | Yann Ylavic <ylavic@apache.org> | 2021-08-25 00:22:40 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2021-08-25 00:22:40 +0200 |
commit | 243c5fad0a8da9a1008681ac60f5b981de6c18d6 (patch) | |
tree | c1ab175d1fdfac1dfbeca0b3ce5e5dc5e50d77ee /server/listen.c | |
parent | mod_proxy_http: Avoid a double call to apr_table_get(). (diff) | |
download | apache2-243c5fad0a8da9a1008681ac60f5b981de6c18d6.tar.xz apache2-243c5fad0a8da9a1008681ac60f5b981de6c18d6.zip |
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
Diffstat (limited to 'server/listen.c')
-rw-r--r-- | server/listen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/listen.c b/server/listen.c index 445d1202c9..812bdd8bb3 100644 --- a/server/listen.c +++ b/server/listen.c @@ -853,7 +853,7 @@ AP_DECLARE(apr_status_t) ap_duplicate_listeners(apr_pool_t *p, server_rec *s, if (val > 1) { *num_buckets = val; } - ap_log_perror(APLOG_MARK, APLOG_INFO, 0, p, APLOGNO(02819) + ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, APLOGNO(02819) "Using %i listeners bucket(s) based on %i " "online CPU cores and a ratio of %i", *num_buckets, num_online_cores, @@ -862,7 +862,7 @@ AP_DECLARE(apr_status_t) ap_duplicate_listeners(apr_pool_t *p, server_rec *s, else #endif if (!warn_once) { - ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, p, APLOGNO(02820) + ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO(02820) "ListenCoresBucketsRatio ignored without " "SO_REUSEPORT and _SC_NPROCESSORS_ONLN " "support: using a single listeners bucket"); |