Welcome! Log In Create A New Profile

Advanced

[nginx] Disabled cloning of sockets without master process (ticket #2403).

Sergey Kandaurov
November 25, 2022 06:48AM
details: https://hg.nginx.org/nginx/rev/09463dd9c504
branches:
changeset: 8105:09463dd9c504
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Nov 23 23:12:04 2022 +0300
description:
Disabled cloning of sockets without master process (ticket #2403).

Cloning of listening sockets for each worker process does not make sense
when working without master process, and causes some of the connections
not to be accepted if worker_processes is set to more than one and there
are listening sockets configured with the reuseport flag. Fix is to
disable cloning when master process is disabled.

diffstat:

src/event/ngx_event.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 4cc2bfeff46c -r 09463dd9c504 src/event/ngx_event.c
--- a/src/event/ngx_event.c Wed Nov 23 17:30:08 2022 +0300
+++ b/src/event/ngx_event.c Wed Nov 23 23:12:04 2022 +0300
@@ -416,6 +416,7 @@ ngx_event_init_conf(ngx_cycle_t *cycle,
{
#if (NGX_HAVE_REUSEPORT)
ngx_uint_t i;
+ ngx_core_conf_t *ccf;
ngx_listening_t *ls;
#endif

@@ -442,7 +443,9 @@ ngx_event_init_conf(ngx_cycle_t *cycle,

#if (NGX_HAVE_REUSEPORT)

- if (!ngx_test_config) {
+ ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
+
+ if (!ngx_test_config && ccf->master) {

ls = cycle->listening.elts;
for (i = 0; i < cycle->listening.nelts; i++) {
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[nginx] Disabled cloning of sockets without master process (ticket #2403).

Sergey Kandaurov 286 November 25, 2022 06:48AM



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

Online Users

Guests: 73
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready