Mercurial > hg > nginx
changeset 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 | 49272f5b45a6 |
children | 64659bcb92d4 |
files | src/core/ngx_string.c src/os/unix/ngx_process.c src/os/unix/ngx_process_cycle.c src/os/unix/ngx_process_cycle.h |
diffstat | 4 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_string.c Mon Sep 07 11:27:37 2009 +0000 +++ b/src/core/ngx_string.c Mon Sep 07 11:31:20 2009 +0000 @@ -87,7 +87,7 @@ * * reserved: * %t ptrdiff_t - * %S null-teminated wchar string + * %S null-terminated wchar string * %C wchar */
--- a/src/os/unix/ngx_process.c Mon Sep 07 11:27:37 2009 +0000 +++ b/src/os/unix/ngx_process.c Mon Sep 07 11:31:20 2009 +0000 @@ -359,6 +359,7 @@ break; case SIGALRM: + ngx_sigalrm = 1; break; case SIGIO:
--- 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;
--- a/src/os/unix/ngx_process_cycle.h Mon Sep 07 11:27:37 2009 +0000 +++ b/src/os/unix/ngx_process_cycle.h Mon Sep 07 11:31:20 2009 +0000 @@ -39,6 +39,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;