#2443 closed defect (invalid)

why ngx_clone_listening?

Reported by: duzhe@… Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.23.x
Keywords: Cc:
uname -a: Linux x1g7 5.15.88-gentoo-b1 #1 SMP Thu Jan 19 20:37:01 CST 2023 x86_64 Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz GenuineIntel GNU/Linux
nginx -V: nginx version: nginx/1.23.2
built with OpenSSL 1.1.1s 1 Nov 2022
TLS SNI support enabled
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/run/nginx.pid --lock-path=/run/lock/nginx.lock --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib64 --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=/var/lib/nginx/tmp/client --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --with-compat --with-http_v2_module --with-pcre --without-pcre2 --with-http_realip_module --with-http_ssl_module --without-stream_access_module --without-stream_geo_module --without-stream_limit_conn_module --without-stream_map_module --without-stream_return_module --without-stream_split_clients_module --without-stream_upstream_hash_module --without-stream_upstream_least_conn_module --without-stream_upstream_zone_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --user=nginx --group=nginx


when reuseport and worker are enabled, nginx will clone the listening entry,then nginx will call socket&&bind&&listen for worker_processes times,with same port,and we got worker_processes listening fd which works all the same. is this necessary? i tried removing the call of ngx_clone_listening it seems works fine.

Attachments (1)

nginx_mini.conf (481 bytes ) - added by duzhe@… 18 months ago.
simple config

Download all attachments as: .zip

Change History (3)

by duzhe@…, 18 months ago

Attachment: nginx_mini.conf added

simple config

comment:1 by duzhe@…, 18 months ago

Sorry, I didn't understand enough about reuseport and missed some details in the source code. Now I understand what happened.

comment:2 by Maxim Dounin, 18 months ago

Resolution: invalid
Status: newclosed

For questions about nginx, please consider using support options available. Thank you.

Note: See TracTickets for help on using tickets.