diff src/os/unix/ngx_process_cycle.c @ 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 a7491af45540
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -37,6 +37,7 @@ ngx_uint_t    ngx_threaded;
 
 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 @@ ngx_master_process_cycle(ngx_cycle_t *cy
 
     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);