瀏覽代碼

Fix nginx worker process looping on timer when quit/terminate/reload

tags/v0.5
Brice Figureau 17 年之前
父節點
當前提交
a1eaf20265
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. 3
    1
      ngx_http_uploadprogress_module.c

+ 3
- 1
ngx_http_uploadprogress_module.c 查看文件

@@ -842,7 +842,9 @@ ngx_clean_old_connections(ngx_event_t * ev)
842 842
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
843 843
                    "uploadprogress clean old connections restarting timer");
844 844
 
845
-    ngx_add_timer(ev, TIMER_FREQUENCY);       /* trigger again in 60s */
845
+    /* don't reschedule timer if ngx_quit or ngx_terminate && nodes emtpy */
846
+    if ( !(ngx_quit || ngx_terminate) && (ngx_rbtree_node_t *) ctx->list_tail.prev != &ctx->list_head.node )
847
+        ngx_add_timer(ev, TIMER_FREQUENCY);       /* trigger again in 60s */
846 848
 
847 849
     ngx_shmtx_unlock(&shpool->mutex);
848 850
 }

Loading…
取消
儲存