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.
This commit is contained in:
Maxim Dounin 2024-01-29 10:29:39 +03:00
parent f255815f5d
commit cc4c3ee0a4
2 changed files with 6 additions and 6 deletions

View File

@ -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,12 +963,12 @@ 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();
}
}
/*
* Copy ngx_cycle->log related data to the special static exit cycle,

View File

@ -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