mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
twice termination delay only after SIGALRM, otherwise many separate SIGCHLD
and SIGIO signals quickly increase delay to the level when SIGKILL is sent
This commit is contained in:
parent
31f6c5c55d
commit
450659e62a
@ -373,6 +373,7 @@ ngx_signal_handler(int signo)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SIGALRM:
|
case SIGALRM:
|
||||||
|
ngx_sigalrm = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIGIO:
|
case SIGIO:
|
||||||
|
@ -37,6 +37,7 @@ ngx_uint_t ngx_threaded;
|
|||||||
|
|
||||||
sig_atomic_t ngx_reap;
|
sig_atomic_t ngx_reap;
|
||||||
sig_atomic_t ngx_sigio;
|
sig_atomic_t ngx_sigio;
|
||||||
|
sig_atomic_t ngx_sigalrm;
|
||||||
sig_atomic_t ngx_terminate;
|
sig_atomic_t ngx_terminate;
|
||||||
sig_atomic_t ngx_quit;
|
sig_atomic_t ngx_quit;
|
||||||
sig_atomic_t ngx_debug_quit;
|
sig_atomic_t ngx_debug_quit;
|
||||||
@ -142,7 +143,10 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
|
|||||||
|
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
if (delay) {
|
if (delay) {
|
||||||
delay *= 2;
|
if (ngx_sigalrm) {
|
||||||
|
delay *= 2;
|
||||||
|
ngx_sigalrm = 0;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
||||||
"termination cycle: %d", delay);
|
"termination cycle: %d", delay);
|
||||||
|
@ -46,6 +46,7 @@ extern ngx_uint_t ngx_exiting;
|
|||||||
|
|
||||||
extern sig_atomic_t ngx_reap;
|
extern sig_atomic_t ngx_reap;
|
||||||
extern sig_atomic_t ngx_sigio;
|
extern sig_atomic_t ngx_sigio;
|
||||||
|
extern sig_atomic_t ngx_sigalrm;
|
||||||
extern sig_atomic_t ngx_quit;
|
extern sig_atomic_t ngx_quit;
|
||||||
extern sig_atomic_t ngx_debug_quit;
|
extern sig_atomic_t ngx_debug_quit;
|
||||||
extern sig_atomic_t ngx_terminate;
|
extern sig_atomic_t ngx_terminate;
|
||||||
|
Loading…
Reference in New Issue
Block a user