Mercurial > hg > nginx-quic
comparison 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 |
comparison
equal
deleted
inserted
replaced
3047:d02b6123b4dc | 3048:846d0e2fa483 |
---|---|
35 ngx_pid_t ngx_pid; | 35 ngx_pid_t ngx_pid; |
36 ngx_uint_t ngx_threaded; | 36 ngx_uint_t ngx_threaded; |
37 | 37 |
38 sig_atomic_t ngx_reap; | 38 sig_atomic_t ngx_reap; |
39 sig_atomic_t ngx_sigio; | 39 sig_atomic_t ngx_sigio; |
40 sig_atomic_t ngx_sigalrm; | |
40 sig_atomic_t ngx_terminate; | 41 sig_atomic_t ngx_terminate; |
41 sig_atomic_t ngx_quit; | 42 sig_atomic_t ngx_quit; |
42 sig_atomic_t ngx_debug_quit; | 43 sig_atomic_t ngx_debug_quit; |
43 ngx_uint_t ngx_exiting; | 44 ngx_uint_t ngx_exiting; |
44 sig_atomic_t ngx_reconfigure; | 45 sig_atomic_t ngx_reconfigure; |
140 delay = 0; | 141 delay = 0; |
141 live = 1; | 142 live = 1; |
142 | 143 |
143 for ( ;; ) { | 144 for ( ;; ) { |
144 if (delay) { | 145 if (delay) { |
145 delay *= 2; | 146 if (ngx_sigalrm) { |
147 delay *= 2; | |
148 ngx_sigalrm = 0; | |
149 } | |
146 | 150 |
147 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | 151 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, |
148 "termination cycle: %d", delay); | 152 "termination cycle: %d", delay); |
149 | 153 |
150 itv.it_interval.tv_sec = 0; | 154 itv.it_interval.tv_sec = 0; |