Mercurial > hg > nginx
changeset 3048:846d0e2fa483
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 | Wed, 26 Aug 2009 15:12:28 +0000 |
parents | d02b6123b4dc |
children | 67254117b774 |
files | src/os/unix/ngx_process.c src/os/unix/ngx_process_cycle.c src/os/unix/ngx_process_cycle.h |
diffstat | 3 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os/unix/ngx_process.c Wed Aug 26 15:09:09 2009 +0000 +++ b/src/os/unix/ngx_process.c Wed Aug 26 15:12:28 2009 +0000 @@ -373,6 +373,7 @@ break; case SIGALRM: + ngx_sigalrm = 1; break; case SIGIO:
--- a/src/os/unix/ngx_process_cycle.c Wed Aug 26 15:09:09 2009 +0000 +++ b/src/os/unix/ngx_process_cycle.c Wed Aug 26 15:12:28 2009 +0000 @@ -37,6 +37,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; @@ -142,7 +143,10 @@ for ( ;; ) { if (delay) { - delay *= 2; + if (ngx_sigalrm) { + delay *= 2; + ngx_sigalrm = 0; + } ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "termination cycle: %d", delay);
--- a/src/os/unix/ngx_process_cycle.h Wed Aug 26 15:09:09 2009 +0000 +++ b/src/os/unix/ngx_process_cycle.h Wed Aug 26 15:12:28 2009 +0000 @@ -46,6 +46,7 @@ extern sig_atomic_t ngx_reap; extern sig_atomic_t ngx_sigio; +extern sig_atomic_t ngx_sigalrm; extern sig_atomic_t ngx_quit; extern sig_atomic_t ngx_debug_quit; extern sig_atomic_t ngx_terminate;