# HG changeset patch # User Igor Sysoev # Date 1252323080 0 # Node ID 4b5cf483c6a8017070c313d6c1c7e70088329e81 # Parent 49272f5b45a672a72f6f759343dfad048e1cd78b 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 diff -r 49272f5b45a6 -r 4b5cf483c6a8 src/core/ngx_string.c --- 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 */ diff -r 49272f5b45a6 -r 4b5cf483c6a8 src/os/unix/ngx_process.c --- 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: diff -r 49272f5b45a6 -r 4b5cf483c6a8 src/os/unix/ngx_process_cycle.c --- 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; diff -r 49272f5b45a6 -r 4b5cf483c6a8 src/os/unix/ngx_process_cycle.h --- 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;