Просмотр исходного кода

more fixes for stuck worker process

tags/v0.5
Brice Figureau 17 лет назад
Родитель
Сommit
eb44976b6a
1 измененных файлов: 12 добавлений и 3 удалений
  1. 12
    3
      ngx_http_uploadprogress_module.c

+ 12
- 3
ngx_http_uploadprogress_module.c Просмотреть файл

800
     ngx_rbtree_node_t               *node;
800
     ngx_rbtree_node_t               *node;
801
     ngx_http_uploadprogress_node_t  *up;
801
     ngx_http_uploadprogress_node_t  *up;
802
     time_t                           now = ngx_time();
802
     time_t                           now = ngx_time();
803
+    int                              count = 0;
803
 
804
 
804
 
805
 
805
     /* scan the rbtree */
806
     /* scan the rbtree */
837
             ngx_slab_free_locked(shpool, node);
838
             ngx_slab_free_locked(shpool, node);
838
         }
839
         }
839
 
840
 
841
+        count++;
840
         node = (ngx_rbtree_node_t *) up->prev;
842
         node = (ngx_rbtree_node_t *) up->prev;
841
     }
843
     }
842
-    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
843
-                   "uploadprogress clean old connections restarting timer");
844
+
845
+    ngx_log_debug3(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
846
+               "uploadprogress clean old connections: quit: %ui term: %ui count: %ui", ngx_quit, ngx_terminate, count);
844
 
847
 
845
     /* 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 */
846
-    if ( !(ngx_quit || ngx_terminate) && (ngx_rbtree_node_t *) ctx->list_tail.prev != &ctx->list_head.node )
849
+    if ( !(ngx_quit || ngx_terminate) && (ngx_rbtree_node_t *) ctx->list_tail.prev != &ctx->list_head.node ) {
850
+        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
851
+                   "uploadprogress clean old connections restarting timer");
847
         ngx_add_timer(ev, TIMER_FREQUENCY);       /* trigger again in 60s */
852
         ngx_add_timer(ev, TIMER_FREQUENCY);       /* trigger again in 60s */
853
+    } else {
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");
856
+    }
848
 
857
 
849
     ngx_shmtx_unlock(&shpool->mutex);
858
     ngx_shmtx_unlock(&shpool->mutex);
850
 }
859
 }

Загрузка…
Отмена
Сохранить