瀏覽代碼

fixing stuck worker on reload/quit/terminate

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

+ 5
- 6
ngx_http_uploadprogress_module.c 查看文件

@@ -837,8 +837,8 @@ ngx_clean_old_connections(ngx_event_t * ev)
837 837
             ngx_rbtree_delete(ctx->rbtree, node);
838 838
             ngx_slab_free_locked(shpool, node);
839 839
         }
840
-
841
-        count++;
840
+        else
841
+            count++;
842 842
         node = (ngx_rbtree_node_t *) up->prev;
843 843
     }
844 844
 
@@ -846,15 +846,14 @@ ngx_clean_old_connections(ngx_event_t * ev)
846 846
                "uploadprogress clean old connections: quit: %ui term: %ui count: %ui", ngx_quit, ngx_terminate, count);
847 847
 
848 848
     /* don't reschedule timer if ngx_quit or ngx_terminate && nodes emtpy */
849
-    if ( !(ngx_quit || ngx_terminate) && (ngx_rbtree_node_t *) ctx->list_tail.prev != &ctx->list_head.node ) {
849
+    if ( count > 0 || !(ngx_quit || ngx_terminate || ngx_exiting)) {
850 850
         ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
851 851
                    "uploadprogress clean old connections restarting timer");
852 852
         ngx_add_timer(ev, TIMER_FREQUENCY);       /* trigger again in 60s */
853
-    } else {
853
+    } else if (ngx_quit || ngx_terminate || ngx_exiting) {
854 854
         ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
855
-                   "uploadprogress clean old connections quitting & no more active connections: not restarting timer");
855
+                   "uploadprogress clean old connections quitting , no more active connections: not restarting timer");
856 856
     }
857
-
858 857
     ngx_shmtx_unlock(&shpool->mutex);
859 858
 }
860 859
 

Loading…
取消
儲存