Welcome! Log In Create A New Profile

Advanced

[nginx] Cache: report error if slab allocator fails during cache loading.

Dmitry Volyntsev
March 18, 2016 10:32AM
details: http://hg.nginx.org/nginx/rev/043914d19be8
branches:
changeset: 6444:043914d19be8
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri Mar 18 14:27:30 2016 +0300
description:
Cache: report error if slab allocator fails during cache loading.

diffstat:

src/http/ngx_http_cache.h | 2 ++
src/http/ngx_http_file_cache.c | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r fc72784b1f52 -r 043914d19be8 src/http/ngx_http_cache.h
--- a/src/http/ngx_http_cache.h Fri Mar 18 06:44:49 2016 +0300
+++ b/src/http/ngx_http_cache.h Fri Mar 18 14:27:30 2016 +0300
@@ -153,6 +153,8 @@ struct ngx_http_file_cache_s {

time_t inactive;

+ time_t fail_time;
+
ngx_uint_t files;
ngx_uint_t loader_files;
ngx_msec_t last;
diff -r fc72784b1f52 -r 043914d19be8 src/http/ngx_http_file_cache.c
--- a/src/http/ngx_http_file_cache.c Fri Mar 18 06:44:49 2016 +0300
+++ b/src/http/ngx_http_file_cache.c Fri Mar 18 14:27:30 2016 +0300
@@ -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;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Cache: report error if slab allocator fails during cache loading.

Dmitry Volyntsev 298 March 18, 2016 10:32AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 237
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready