aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2011-12-12 10:49:14 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2011-12-12 10:49:14 +0000
commit614a7ef18d6c35a6fefd478dda7e24d5b4e679ea (patch)
tree010ab73073970ed24ff158c380c5c9d2a42638c3 /src
parent64a9f700929dbc8f0730be4f91cc3bbfde8fc3e6 (diff)
downloadnginx-614a7ef18d6c35a6fefd478dda7e24d5b4e679ea.tar.gz
nginx-614a7ef18d6c35a6fefd478dda7e24d5b4e679ea.zip
Cache: only complain on long locked entries.
There have been multiple reports of cases where a real locked entry was removed, resulting in a segmentation fault later in a worker which locked the entry. It looks like default inactive timeout isn't enough in real life. For now just ignore such locked entries, and move them to the top of the inactive queue to allow processing of other entries.
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_file_cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c
index cb329aa9b..050f356f1 100644
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -1113,12 +1113,12 @@ ngx_http_file_cache_expire(ngx_http_file_cache_t *cache)
/*
* abnormally exited workers may leave locked cache entries,
* and although it may be safe to remove them completely,
- * we prefer to remove them from inactive queue and rbtree
- * only, and to allow other leaks
+ * we prefer to just move them to the top of the inactive queue
*/
ngx_queue_remove(q);
- ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node);
+ fcn->expire = ngx_time() + cache->inactive;
+ ngx_queue_insert_head(&cache->sh->queue, &fcn->queue);
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
"ignore long locked inactive cache entry %*s, count:%d",