Opened 6 years ago
Closed 6 years ago
#1426 closed defect (invalid)
nginx master-worker communication channel problem?
|Reported by:||Owned by:|
|uname -a:||Linux midea-S30 4.4.0-98-generic #121~14.04.1-Ubuntu SMP Wed Oct 11 11:54:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux|
nginx version: nginx/1.10.3
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
built with OpenSSL 1.0.2g 1 Mar 2016
TLS SNI support enabled
configure arguments: --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=../pcre-8.40 --with-zlib=../zlib-1.2.11
nginx version: nginx1.10.3
In ngx_process.c, function ngx_spawn_process() use the following:
socketpair(AF_UNIX, SOCK_STREAM, 0, ngx_processes[s].channel)
and create two channel, then use fork() to create a new process. In the child process, it close the channel and use channel to receive the master's message . The master process use channel to send message to the worker. And here I found that the master's channel has not closed, is it a bug?
Change History (1)
comment:1 by , 6 years ago
|Status:||new → closed|
Note: See TracTickets for help on using tickets.
No, certainly it is not a bug - nothing wrong happens due to this behaviour. Moreover, clearly this is intentional, as the code closes unneeded
channelsockets in the
ngx_close_channel()unconditionally closes both sockets.
The code probably can be optimized to close
channelearlier, though this will require changes in various places, including ones mentioned above.