From b694456ef363c98d12561992dc5c4f019cfe5085 Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Mon, 4 Nov 2013 13:08:57 -0800 Subject: [PATCH] bugfix: applied the cache_manager_exit patch to the nginx core to fix an issue when the cache manager process is shutting down. --- patches/nginx-1.4.3-cache_manager_exit.patch | 19 +++++++++++++++++++ util/mirror-tarballs | 4 ++++ 2 files changed, 23 insertions(+) create mode 100644 patches/nginx-1.4.3-cache_manager_exit.patch diff --git a/patches/nginx-1.4.3-cache_manager_exit.patch b/patches/nginx-1.4.3-cache_manager_exit.patch new file mode 100644 index 0000000..f1f81da --- /dev/null +++ b/patches/nginx-1.4.3-cache_manager_exit.patch @@ -0,0 +1,19 @@ +# HG changeset patch +# User Yichun Zhang +# 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) { diff --git a/util/mirror-tarballs b/util/mirror-tarballs index fc6d087..bc13508 100755 --- a/util/mirror-tarballs +++ b/util/mirror-tarballs @@ -199,6 +199,10 @@ echo "$info_txt applying the proxy_host_port_vars patch for nginx $ver" patch -p1 < $root/patches/nginx-$ver-proxy_host_port_vars.patch || exit 1 echo +echo "$info_txt applying the cache_manager_exit patch for nginx $ver" +patch -p1 < $root/patches/nginx-$ver-cache_manager_exit.patch || exit 1 +echo + rm -f *.patch || exit 1 cd .. || exit 1