aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_process_cycle.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2017-03-07 18:51:15 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2017-03-07 18:51:15 +0300
commit1a58418ae76a96c830a0536432e96a9ad051bc58 (patch)
treefb1df1b233a9225fdcf343abeffbfb903fb19b3f /src/os/unix/ngx_process_cycle.c
parent0212c7fac1a63d33c9b0084ed75803713af8a230 (diff)
downloadnginx-1a58418ae76a96c830a0536432e96a9ad051bc58.tar.gz
nginx-1a58418ae76a96c830a0536432e96a9ad051bc58.zip
Cancelable timers are now preserved if there are other timers.
There is no need to cancel timers early if there are other timers blocking shutdown anyway. Preserving such timers allows nginx to continue some periodic work till the shutdown is actually possible. With the new approach, timers with ev->cancelable are simply ignored when checking if there are any timers left during shutdown.
Diffstat (limited to 'src/os/unix/ngx_process_cycle.c')
-rw-r--r--src/os/unix/ngx_process_cycle.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
index 5c4e21dfd..d0c61143e 100644
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -738,10 +738,7 @@ ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
for ( ;; ) {
if (ngx_exiting) {
- ngx_event_cancel_timers();
-
- if (ngx_event_timer_rbtree.root == ngx_event_timer_rbtree.sentinel)
- {
+ if (ngx_event_no_timers_left() == NGX_OK) {
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
ngx_worker_process_exit(cycle);