diff options
author | Stefan Eissing <icing@apache.org> | 2022-02-25 14:18:51 +0100 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2022-02-25 14:18:51 +0100 |
commit | 3b7cc4481cf69328c8648a05b2b8cada9b9e8b39 (patch) | |
tree | 7f0122f22a70632dac749d7af9e09a519185ab72 /server | |
parent | *) test: check for the mpm module used and disable http2 tests (diff) | |
download | apache2-3b7cc4481cf69328c8648a05b2b8cada9b9e8b39.tar.xz apache2-3b7cc4481cf69328c8648a05b2b8cada9b9e8b39.zip |
*) mod_watchdog: add assertions to cleanup code
*) core/mpm_preform: do not invoke the fancy new child_stopping/stopped
hooks when invoked from a signal handler. This is a stopgap to some
strange behaviour in need of some deeper insight.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898418 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/mpm/prefork/prefork.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 71532d611c..e26ee4f7ef 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -218,8 +218,8 @@ static void prefork_note_child_started(int slot, pid_t pid) } /* a clean exit from a child with proper cleanup */ -static void clean_child_exit(int code) __attribute__ ((noreturn)); -static void clean_child_exit(int code) +static void clean_child_exit_ex(int code, int from_signal) __attribute__ ((noreturn)); +static void clean_child_exit_ex(int code, int from_signal) { apr_signal(SIGHUP, SIG_IGN); apr_signal(SIGTERM, SIG_IGN); @@ -227,9 +227,9 @@ static void clean_child_exit(int code) retained->mpm->mpm_state = AP_MPMQ_STOPPING; if (pchild) { - if (code == 0) { - ap_run_child_stopping(pchild, 0); - ap_run_child_stopped(pchild, 0); + if (!code && !from_signal) { + ap_run_child_stopping(pchild, !retained->mpm->is_ungraceful); + ap_run_child_stopped(pchild, !retained->mpm->is_ungraceful); } apr_pool_destroy(pchild); /* @@ -248,6 +248,13 @@ static void clean_child_exit(int code) exit(code); } +/* a clean exit from a child with proper cleanup */ +static void clean_child_exit(int code) __attribute__ ((noreturn)); +static void clean_child_exit(int code) +{ + clean_child_exit_ex(code, 0); +} + static apr_status_t accept_mutex_on(void) { apr_status_t rv = apr_proc_mutex_lock(my_bucket->mutex); @@ -364,7 +371,7 @@ static const char *prefork_get_name(void) static void just_die(int sig) { - clean_child_exit(0); + clean_child_exit_ex(0, 1); } /* volatile because it's updated from a signal handler */ |