Welcome! Log In Create A New Profile

Advanced

[nginx] Master process: make sure unix domain sockets are removed from disk when performing graceful shutdown.

Datong Sun via nginx-devel
December 02, 2016 04:22AM
# HG changeset patch
# User Datong Sun <dndx@idndx.com>
# Date 1480669608 21600
# Fri Dec 02 03:06:48 2016 -0600
# Node ID 1b7a6785d1f3c76f436a9dea5cb0fc86e1db5f2b
# Parent 75dbab4ea930bc73cca98d183c2f556eb5125462
Master process: make sure unix domain sockets are removed from
disk when performing graceful shutdown by using
ngx_close_listening_sockets() to close them.

This fixes https://trac.nginx.org/nginx/ticket/753

diff -r 75dbab4ea930 -r 1b7a6785d1f3 src/os/unix/ngx_process_cycle.c
--- a/src/os/unix/ngx_process_cycle.c Mon Nov 21 16:03:42 2016 +0300
+++ b/src/os/unix/ngx_process_cycle.c Fri Dec 02 03:06:48 2016 -0600
@@ -76,12 +76,11 @@
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);
@@ -203,16 +202,7 @@
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;
}

--
Datong Sun
dndx@idndx.com

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

[nginx] Master process: make sure unix domain sockets are removed from disk when performing graceful shutdown.

Datong Sun via nginx-devel 574 December 02, 2016 04:22AM



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

Online Users

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