[njs] Fixed js_periodic handler stopping after graceful shutdown.

Dmitry Volyntsev xeioex at nginx.com
Thu Aug 31 04:01:42 UTC 2023


details:   https://hg.nginx.org/njs/rev/77bdb1e544da
branches:  
changeset: 2188:77bdb1e544da
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Aug 30 20:59:11 2023 -0700
description:
Fixed js_periodic handler stopping after graceful shutdown.

The issue was introduced in f1bd0b1db065.

diffstat:

 nginx/ngx_http_js_module.c   |  4 ++++
 nginx/ngx_stream_js_module.c |  4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r 3fe16507f80a -r 77bdb1e544da nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Wed Aug 30 18:59:28 2023 -0700
+++ b/nginx/ngx_http_js_module.c	Wed Aug 30 20:59:11 2023 -0700
@@ -4102,6 +4102,10 @@ ngx_http_js_periodic_handler(ngx_event_t
     ngx_http_request_t     *r;
     ngx_http_connection_t   hc;
 
+    if (ngx_terminate || ngx_exiting) {
+        return;
+    }
+
     periodic = ev->data;
 
     timer = periodic->interval;
diff -r 3fe16507f80a -r 77bdb1e544da nginx/ngx_stream_js_module.c
--- a/nginx/ngx_stream_js_module.c	Wed Aug 30 18:59:28 2023 -0700
+++ b/nginx/ngx_stream_js_module.c	Wed Aug 30 20:59:11 2023 -0700
@@ -1815,6 +1815,10 @@ ngx_stream_js_periodic_handler(ngx_event
     ngx_stream_session_t         *s;
     ngx_stream_core_main_conf_t  *cmcf;
 
+    if (ngx_terminate || ngx_exiting) {
+        return;
+    }
+
     periodic = ev->data;
 
     timer = periodic->interval;


More information about the nginx-devel mailing list