Welcome! Log In Create A New Profile

Advanced

[nginx] Fixed SIGQUIT not removing listening UNIX sockets (closes #753).

June 01, 2020 03:34PM
details: https://hg.nginx.org/nginx/rev/7cbf6389194b
branches:
changeset: 7663:7cbf6389194b
user: Ruslan Ermilov <ru@nginx.com>
date: Mon Jun 01 22:31:23 2020 +0300
description:
Fixed SIGQUIT not removing listening UNIX sockets (closes #753).

Listening UNIX sockets were not removed on graceful shutdown, preventing
the next runs. The fix is to replace the custom socket closing code in
ngx_master_process_cycle() by the ngx_close_listening_sockets() call.

diffstat:

src/os/unix/ngx_process_cycle.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)

diffs (35 lines):

diff -r 9c038f5e0464 -r 7cbf6389194b src/os/unix/ngx_process_cycle.c
--- a/src/os/unix/ngx_process_cycle.c Mon Jun 01 20:19:27 2020 +0300
+++ b/src/os/unix/ngx_process_cycle.c Mon Jun 01 22:31:23 2020 +0300
@@ -77,12 +77,11 @@ ngx_master_process_cycle(ngx_cycle_t *cy
u_char *p;
size_t size;
ngx_int_t i;
- ngx_uint_t n, sigio;
+ ngx_uint_t sigio;
sigset_t set;
struct itimerval itv;
ngx_uint_t live;
ngx_msec_t delay;
- ngx_listening_t *ls;
ngx_core_conf_t *ccf;

sigemptyset(&set);
@@ -204,16 +203,7 @@ ngx_master_process_cycle(ngx_cycle_t *cy
if (ngx_quit) {
ngx_signal_worker_processes(cycle,
ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
-
- ls = cycle->listening.elts;
- for (n = 0; n < cycle->listening.nelts; n++) {
- if (ngx_close_socket(ls[n].fd) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno,
- ngx_close_socket_n " %V failed",
- &ls[n].addr_text);
- }
- }
- cycle->listening.nelts = 0;
+ ngx_close_listening_sockets(cycle);

continue;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed SIGQUIT not removing listening UNIX sockets (closes #753).

ru@nginx.com 514 June 01, 2020 03:34PM



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

Online Users

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