diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2024-01-29 10:29:39 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2024-01-29 10:29:39 +0300 |
commit | cc4c3ee0a45ca3a2eeac2874e9199bf42560015c (patch) | |
tree | 03789f919ee9619d735e8942a769e2b8c0d8db5c /src | |
parent | f255815f5d161fab0dd310fe826d4f7572e141f2 (diff) | |
download | nginx-cc4c3ee0a45ca3a2eeac2874e9199bf42560015c.tar.gz nginx-cc4c3ee0a45ca3a2eeac2874e9199bf42560015c.zip |
Silenced complaints about socket leaks on forced termination.
When graceful shutdown was requested, and then nginx was forced to
do fast shutdown, it used to (incorrectly) complain about open sockets
left in connections which weren't yet closed when fast shutdown
was requested.
Fix is to avoid complaining about open sockets when fast shutdown was
requested after graceful one. Abnormal termination, if requested with
the WINCH signal, can still happen though.
Diffstat (limited to 'src')
-rw-r--r-- | src/os/unix/ngx_process_cycle.c | 10 | ||||
-rw-r--r-- | src/os/win32/ngx_process_cycle.c | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index 98d2dd29b..5bc5ce979 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -948,7 +948,7 @@ ngx_worker_process_exit(ngx_cycle_t *cycle) } } - if (ngx_exiting) { + if (ngx_exiting && !ngx_terminate) { c = cycle->connections; for (i = 0; i < cycle->connection_n; i++) { if (c[i].fd != -1 @@ -963,11 +963,11 @@ ngx_worker_process_exit(ngx_cycle_t *cycle) ngx_debug_quit = 1; } } + } - if (ngx_debug_quit) { - ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "aborting"); - ngx_debug_point(); - } + if (ngx_debug_quit) { + ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "aborting"); + ngx_debug_point(); } /* diff --git a/src/os/win32/ngx_process_cycle.c b/src/os/win32/ngx_process_cycle.c index 0c848eff4..a39335fd1 100644 --- a/src/os/win32/ngx_process_cycle.c +++ b/src/os/win32/ngx_process_cycle.c @@ -834,7 +834,7 @@ ngx_worker_process_exit(ngx_cycle_t *cycle) } } - if (ngx_exiting) { + if (ngx_exiting && !ngx_terminate) { c = cycle->connections; for (i = 0; i < cycle->connection_n; i++) { if (c[i].fd != (ngx_socket_t) -1 |