Mercurial > hg > nginx
diff src/os/unix/ngx_process_cycle.c @ 3102:4b5cf483c6a8 stable-0.7
merge r3047, r3048, r3049:
twice termination delay only after SIGALRM, otherwise many separate SIGCHLD
and SIGIO signals quickly increase delay to the level when SIGKILL is sent
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Sep 2009 11:31:20 +0000 |
parents | d19979e0d980 |
children | 1f3cd08ebb82 |
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c Mon Sep 07 11:27:37 2009 +0000 +++ b/src/os/unix/ngx_process_cycle.c Mon Sep 07 11:31:20 2009 +0000 @@ -34,6 +34,7 @@ sig_atomic_t ngx_reap; sig_atomic_t ngx_sigio; +sig_atomic_t ngx_sigalrm; sig_atomic_t ngx_terminate; sig_atomic_t ngx_quit; sig_atomic_t ngx_debug_quit; @@ -130,10 +131,13 @@ for ( ;; ) { if (delay) { - delay *= 2; + if (ngx_sigalrm) { + delay *= 2; + ngx_sigalrm = 0; + } ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, - "temination cycle: %d", delay); + "termination cycle: %d", delay); itv.it_interval.tv_sec = 0; itv.it_interval.tv_usec = 0; @@ -492,8 +496,7 @@ if (kill(ngx_processes[i].pid, signo) == -1) { err = ngx_errno; ngx_log_error(NGX_LOG_ALERT, cycle->log, err, - "kill(%P, %d) failed", - ngx_processes[i].pid, signo); + "kill(%P, %d) failed", ngx_processes[i].pid, signo); if (err == NGX_ESRCH) { ngx_processes[i].exited = 1;