diff src/http/ngx_http_file_cache.c @ 6444:043914d19be8

Cache: report error if slab allocator fails during cache loading.
author Dmitry Volyntsev <xeioex@nginx.com>
date Fri, 18 Mar 2016 14:27:30 +0300
parents 9fd738b85fad
children c9d680b00744
line wrap: on
line diff
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -2094,6 +2094,12 @@ ngx_http_file_cache_add(ngx_http_file_ca
         fcn = ngx_slab_calloc_locked(cache->shpool,
                                      sizeof(ngx_http_file_cache_node_t));
         if (fcn == NULL) {
+            if (cache->fail_time != ngx_time()) {
+                cache->fail_time = ngx_time();
+                ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
+                           "could not allocate node%s", cache->shpool->log_ctx);
+            }
+
             ngx_shmtx_unlock(&cache->shpool->mutex);
             return NGX_ERROR;
         }