Welcome! Log In Create A New Profile

Advanced

[PATCH] Cache: gracefully exit the cache manager process

Yichun Zhang (agentzh)
November 04, 2013 03:58PM
Hello!

I've recently run into an issue in the nginx cache manager process
which does not call ngx_worker_process_exit to gracefully exit, thus
tragically skipping all my cleanup code registered by my (3rd-party)
modules.

Below is a patch to fix this. This fix also makes the cache manager
process valgrind-clean.

Thanks!
-agentzh

# HG changeset patch
# User Yichun Zhang <agentzh@gmail.com>
# Date 1383598130 28800
# Node ID f64218e1ac963337d84092536f588b8e0d99bbaa
# Parent dea321e5c0216efccbb23e84bbce7cf3e28f130c
Cache: gracefully exit the cache manager process.

diff -r dea321e5c021 -r f64218e1ac96 src/os/unix/ngx_process_cycle.c
--- a/src/os/unix/ngx_process_cycle.c Thu Oct 31 18:23:49 2013 +0400
+++ b/src/os/unix/ngx_process_cycle.c Mon Nov 04 12:48:50 2013 -0800
@@ -1335,7 +1335,7 @@

if (ngx_terminate || ngx_quit) {
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
- exit(0);
+ ngx_worker_process_exit(cycle);
}

if (ngx_reopen) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Cache: gracefully exit the cache manager process

Yichun Zhang (agentzh) 916 November 04, 2013 03:58PM

Re: [PATCH] Cache: gracefully exit the cache manager process

Maxim Dounin 291 November 04, 2013 04:32PM

Re: [PATCH] Cache: gracefully exit the cache manager process

Yichun Zhang (agentzh) 271 November 04, 2013 05:08PM

Re: [PATCH] Cache: gracefully exit the cache manager process

Maxim Dounin 333 November 04, 2013 07:08PM



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

Online Users

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