nginx-patches icon indicating copy to clipboard operation
nginx-patches copied to clipboard

per-worker-listener and nginx 1.10.1 failed

Open waster opened this issue 8 years ago • 4 comments

Hello,

Tried to apply per-worker-listener patch with nginx 1.10.1 and it was failed:

# patch -p1 < per-worker-listener
patching file src/core/ngx_connection.c
Hunk #2 succeeded at 387 (offset 75 lines).
Hunk #3 succeeded at 444 (offset 100 lines).
Hunk #4 succeeded at 593 with fuzz 1 (offset 126 lines).
patching file src/core/ngx_connection.h
Hunk #1 succeeded at 56 (offset 2 lines).
patching file src/http/ngx_http.c
Hunk #1 succeeded at 1823 with fuzz 1 (offset 6 lines).
patching file src/http/ngx_http_core_module.c
Hunk #1 succeeded at 4035 (offset 9 lines).
patching file src/http/ngx_http_core_module.h
Hunk #1 succeeded at 76 (offset 4 lines).
patching file src/os/unix/ngx_process.c
patching file src/os/unix/ngx_process.h
patching file src/os/unix/ngx_process_cycle.c
Hunk #1 succeeded at 731 with fuzz 2 (offset -6 lines).
Hunk #2 FAILED at 972.
1 out of 2 hunks FAILED -- saving rejects to file src/os/unix/ngx_process_cycle.c.rej

Can it be fixed please?

waster avatar Jun 27 '16 19:06 waster

patching file src/core/ngx_connection.c
Hunk #2 succeeded at 388 (offset 76 lines).
Hunk #3 succeeded at 445 (offset 101 lines).
Hunk #4 succeeded at 594 with fuzz 1 (offset 127 lines).
patching file src/core/ngx_connection.h
Hunk #1 succeeded at 56 (offset 2 lines).
patching file src/http/ngx_http.c
Hunk #1 succeeded at 1775 with fuzz 1 (offset -42 lines).
patching file src/http/ngx_http_core_module.c
Hunk #1 succeeded at 3994 (offset -32 lines).
patching file src/http/ngx_http_core_module.h
Hunk #1 FAILED at 72.
1 out of 1 hunk FAILED -- saving rejects to file src/http/ngx_http_core_module.h.rej
patching file src/os/unix/ngx_process.c
patching file src/os/unix/ngx_process.h
patching file src/os/unix/ngx_process_cycle.c
Hunk #1 succeeded at 731 with fuzz 2 (offset -6 lines).
Hunk #2 FAILED at 972.
1 out of 2 hunks FAILED -- saving rejects to file src/os/unix/ngx_process_cycle.c.rej

Got this issue on NGINX 1.12.0 also. @waster did you found a solution?

kenanchristian avatar Apr 19 '17 01:04 kenanchristian

I also had this issue in 1.9.15, also with the final hunk failing

The modified code is actually just a few lines further down than the diff specifies. If you open the file ngx_process_cycle.c you can make the change manually. After that it compiled fine for me, with the per worker listeners available

Starcross avatar Jul 19 '17 13:07 Starcross

will author update the patch for the latest version of nginx?

lystormenvoy avatar Apr 08 '18 09:04 lystormenvoy

I am using nginx 1.18.04 and had to update the patch in a few places. Looking at where the issues in the patch were occurring I was able to modify it slightly and get the patch to work (working just means the patch command is not failing). However, I am unable to get the per_worker to work :(

I receive this message when the server starts:

2021/05/18 22:06:58 [emerg] 9#9: close() socket 0.0.0.0:9000 failed (9: Bad file descriptor)

nginx.conf

worker_processes 5;

events {
    worker_connections 10000;
    accept_mutex off;
}

http {
    sendfile off;
    tcp_nopush on;
    directio 512;

    # HTTP Server for the video fragments
    server {
        listen 8080;
        listen 9000 per_worker;

        location /control {
            rtmp_control all;
        }

        location /hls {.....

@arut could you provide any guidance on this? Our application needs to be able to use the /control to disconnect users streams if they are abusing the platform but we also ideally use multiple worker_processes for optimal performance on larger compute nodes.

noahschumacher avatar May 18 '21 22:05 noahschumacher