Welcome! Log In Create A New Profile

Advanced

[nginx] Cache: added ngx_quit check to ngx_http_file_cache_expir...

Maxim Dounin
April 30, 2014 11:20AM
details: http://hg.nginx.org/nginx/rev/5748ce74c1cc
branches:
changeset: 5679:5748ce74c1cc
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Apr 30 19:16:35 2014 +0400
description:
Cache: added ngx_quit check to ngx_http_file_cache_expire().

While managing big caches it is possible that expiring old cache items
in ngx_http_file_cache_expire() will take a while. Added a check for
ngx_quit / ngx_terminate to make sure cache manager can be terminated
while in ngx_http_file_cache_expire().

diffstat:

src/http/ngx_http_file_cache.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -1313,6 +1313,11 @@ ngx_http_file_cache_expire(ngx_http_file

for ( ;; ) {

+ if (ngx_quit || ngx_terminate) {
+ wait = 1;
+ break;
+ }
+
if (ngx_queue_empty(&cache->sh->queue)) {
wait = 10;
break;

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

[nginx] Cache: added ngx_quit check to ngx_http_file_cache_expir...

Maxim Dounin 513 April 30, 2014 11:20AM



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

Online Users

Guests: 271
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