Sfoglia il codice sorgente

fixing stuck worker on reload/quit/terminate

tags/v0.5
Brice Figureau 17 anni fa
parent
commit
6d6f24fad8
1 ha cambiato i file con 5 aggiunte e 6 eliminazioni
  1. 5
    6
      ngx_http_uploadprogress_module.c

+ 5
- 6
ngx_http_uploadprogress_module.c Vedi File

837
             ngx_rbtree_delete(ctx->rbtree, node);
837
             ngx_rbtree_delete(ctx->rbtree, node);
838
             ngx_slab_free_locked(shpool, node);
838
             ngx_slab_free_locked(shpool, node);
839
         }
839
         }
840
-
841
-        count++;
840
+        else
841
+            count++;
842
         node = (ngx_rbtree_node_t *) up->prev;
842
         node = (ngx_rbtree_node_t *) up->prev;
843
     }
843
     }
844
 
844
 
846
                "uploadprogress clean old connections: quit: %ui term: %ui count: %ui", ngx_quit, ngx_terminate, count);
846
                "uploadprogress clean old connections: quit: %ui term: %ui count: %ui", ngx_quit, ngx_terminate, count);
847
 
847
 
848
     /* don't reschedule timer if ngx_quit or ngx_terminate && nodes emtpy */
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
         ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
850
         ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
851
                    "uploadprogress clean old connections restarting timer");
851
                    "uploadprogress clean old connections restarting timer");
852
         ngx_add_timer(ev, TIMER_FREQUENCY);       /* trigger again in 60s */
852
         ngx_add_timer(ev, TIMER_FREQUENCY);       /* trigger again in 60s */
853
-    } else {
853
+    } else if (ngx_quit || ngx_terminate || ngx_exiting) {
854
         ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
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
     ngx_shmtx_unlock(&shpool->mutex);
857
     ngx_shmtx_unlock(&shpool->mutex);
859
 }
858
 }
860
 
859
 

Loading…
Annulla
Salva