]> git.kaiwu.me - nginx.git/commitdiff
Upstream: suppressed the file cache slab allocator error messages.
authorRoman Arutyunyan <arut@nginx.com>
Fri, 5 Sep 2014 14:14:59 +0000 (18:14 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Fri, 5 Sep 2014 14:14:59 +0000 (18:14 +0400)
The messages "ngx_slab_alloc() failed: no memory in cache keys zone"
from the file cache slab allocator are suppressed since the allocation
is likely to succeed after the forced expiration of cache nodes.
The second allocation failure is reported.

src/http/ngx_http_file_cache.c

index 71e6e36c235a906f89db2e145b25a8a1eecca2a8..2eebc3068ef9a8a15cf3c72c65ef317f7037b780 100644 (file)
@@ -145,6 +145,8 @@ ngx_http_file_cache_init(ngx_shm_zone_t *shm_zone, void *data)
     ngx_sprintf(cache->shpool->log_ctx, " in cache keys zone \"%V\"%Z",
                 &shm_zone->shm.name);
 
+    cache->shpool->log_nomem = 0;
+
     return NGX_OK;
 }
 
@@ -698,6 +700,8 @@ ngx_http_file_cache_exists(ngx_http_file_cache_t *cache, ngx_http_cache_t *c)
         fcn = ngx_slab_calloc_locked(cache->shpool,
                                      sizeof(ngx_http_file_cache_node_t));
         if (fcn == NULL) {
+            ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
+                          "could not allocate node%s", cache->shpool->log_ctx);
             rc = NGX_ERROR;
             goto failed;
         }