File cache inactive queue full

Vinicius Mignot vinicius.mignot at azion.com
Fri Sep 1 18:55:57 UTC 2017


Hello,

I’m facing some problems when file cache is being cleaned by hitting watermark. Some files are not deleted after getting in expiring criteria, they just keep being moved to the head of the inactive queue. After some time, all top positions are filled and no files are removed anymore. 

I have some guesses and I believe your opinion will be valuable on my quest :)

1. Is it possible that a race condition affects this code? If c->updating ou c->lock_time is changed somewhere else, fcn->updating will keep true, and won’t ever be removed:
src/http/ngx_http_file_cache.c

0419     if (!c->node->updating || (ngx_msec_int_t) timer <= 0) {
0420         c->node->updating = 1;
0421         c->node->lock_time = now + c->lock_age;
0422         c->updating = 1;
0423         c->lock_time = c->node->lock_time;
0424     }

1634     if (c->updating && fcn->lock_time == c->lock_time) {
1635         fcn->updating = 0;
1636     }

2. In the ngx_http_upstream_intercept_errors function there is a call to ngx_http_file_cache_free function, but it seems that without a call to file_cache_lock before some parameters may be uninitialized in the ngx_http_cache_t structure passed as parameter. 

Have you faced any problem like this? Do you have any suggestions about where to look to fix this behavior?

I’m using nginx 1.10.3.

Thanks!

Vinicius.


More information about the nginx-devel mailing list