Welcome! Log In Create A New Profile

Advanced

lingering_close closes client connections

Posted by Ortal 
lingering_close closes client connections
November 14, 2017 11:32AM
Hello,

I am building a nginx module which get parsed http requests send it to my server, wait for the response from my server and send the client http response.

The nginx close my client connections due to lingering_close:

#3 0x0000000000477647 in ngx_http_terminate_request (r=0x1cb1050, rc=-2) at src/http/ngx_http_request.c:2466
#4 0x0000000000476fb5 in ngx_http_finalize_request (r=0x1cb1050, rc=-2) at src/http/ngx_http_request.c:2303
#5 0x0000000000466b0a in ngx_http_core_content_phase (r=0x1cb1050, ph=0x1bcb6e8) at src/http/ngx_http_core_module.c:1370
#6 0x00000000004653b9 in ngx_http_core_run_phases (r=0x1cb1050) at src/http/ngx_http_core_module.c:847
#7 0x0000000000465304 in ngx_http_handler (r=0x1cb1050) at src/http/ngx_http_core_module.c:830
#8 0x00000000004762e3 in ngx_http_process_request (r=0x1cb1050) at src/http/ngx_http_request.c:1910
#9 0x0000000000474afe in ngx_http_process_request_headers (rev=0x1bcf350) at src/http/ngx_http_request.c:1342
#10 0x0000000000473e95 in ngx_http_process_request_line (rev=0x1bcf350) at src/http/ngx_http_request.c:1022
#11 0x0000000000453c68 in ngx_epoll_process_events (cycle=0x1b8c5c0, timer=500, flags=1) at src/event/modules/ngx_epoll_module.c:822
#12 0x0000000000442346 in ngx_process_events_and_timers (cycle=0x1b8c5c0) at src/event/ngx_event.c:242
#13 0x00000000004514df in ngx_worker_process_cycle (cycle=0x1b8c5c0, data=0x6) at src/os/unix/ngx_process_cycle.c:753
#14 0x000000000044d9a1 in ngx_spawn_process (cycle=0x1b8c5c0, proc=0x4513db <ngx_worker_process_cycle>, data=0x6, name=0x4f5793 "worker process", respawn=-3) at src/os/unix/ngx_process.c:198
#15 0x0000000000450257 in ngx_start_worker_processes (cycle=0x1b8c5c0, n=20, type=-3) at src/os/unix/ngx_process_cycle.c:358
#16 0x000000000044f7ec in ngx_master_process_cycle (cycle=0x1b8c5c0) at src/os/unix/ngx_process_cycle.c:130
#17 0x000000000040ff5c in main (argc=5, argv=0x7fff4c6c5698) at src/core/nginx.c:367


The flow close my request when it is still in progress.

I tried to configure the nginx conf in a few ways but got the same problem:

First config:
lingering_close on;
lingering_time 1000s;
lingering_timeout 600s;

Second config:
lingering_close always;

Third config:
lingering_close off;

Can I disable the flag?

Thanks!
Re: lingering_close closes client connections
November 16, 2017 09:52AM
Wrong stack...
#3 0x00000000004799f5 in ngx_http_free_request (r=0x2a04d80, rc=0) at src/http/ngx_http_request.c:3434
#4 0x00000000004798f0 in ngx_http_close_request (r=0x2a04d80, rc=0) at src/http/ngx_http_request.c:3405
#5 0x0000000000479383 in ngx_http_lingering_close_handler (rev=0x27821d0) at src/http/ngx_http_request.c:3265
#6 0x0000000000444dd2 in ngx_event_process_posted (cycle=0x273f5c0, posted=0x73c0d0 <ngx_posted_events>) at src/event/ngx_event_posted.c:33
#7 0x00000000004423d9 in ngx_process_events_and_timers (cycle=0x273f5c0) at src/event/ngx_event.c:259
#8 0x00000000004514df in ngx_worker_process_cycle (cycle=0x273f5c0, data=0x0) at src/os/unix/ngx_process_cycle.c:753
#9 0x000000000044d9a1 in ngx_spawn_process (cycle=0x273f5c0, proc=0x4513db <ngx_worker_process_cycle>, data=0x0, name=0x4f5793 "worker process", respawn=-3) at src/os/unix/ngx_process.c:198
#10 0x0000000000450257 in ngx_start_worker_processes (cycle=0x273f5c0, n=20, type=-3) at src/os/unix/ngx_process_cycle.c:358
#11 0x000000000044f7ec in ngx_master_process_cycle (cycle=0x273f5c0) at src/os/unix/ngx_process_cycle.c:130
#12 0x000000000040ff5c in main (argc=5, argv=0x7ffed4af4838) at src/core/nginx.c:367
(gdb) packet_write_wait: Connection to 192.168.224.73 port 22: Broken pipe
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 71
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 254 on July 05, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready