nic-6443 commented on issue #9273: URL: https://github.com/apache/apisix/issues/9273#issuecomment-1511049889
I modified the code of lua-resty-http to immediately close the socket after sending an HTTP request, which can simulate the network packets flow in your screenshot (**Send FIN packet after sending the HTTP request)**. However, I found that it does not cause a Lua thread crash, but only get a`socket closed` error in log. ``` 2023/04/17 09:48:39 [error] 363#363: *5 [lua] init.lua:198: connect consul: http://nic-dev:8500/v1 by sub url: /catalog/services, got watch result: null, with error: closed, context: ngx.timer ``` ``` 09:48:39.707205 IP 172.30.5.150.42324 > 172.23.7.107.8500: Flags [S], seq 3973141903, win 64860, options [mss 1410,sackOK,TS val 3448063609 ecr 0,nop,wscale 7], length 0 E..<..@[email protected]!4..U........\ee......... ..Fy........ 09:48:39.751331 IP 172.23.7.107.8500 > 172.30.5.150.42324: Flags [S.], seq 1655061838, ack 3973141904, win 63204, options [mss 2760,sackOK,TS val 3914390939 ecr 3448063609,nop,wscale 7], length 0 E..<..@.?......k....!4.Tb.=N..U.....b..... .... .P....Fy.... 09:48:39.751365 IP 172.30.5.150.42324 > 172.23.7.107.8500: Flags [.], ack 1, win 507, options [nop,nop,TS val 3448063654 ecr 3914390939], length 0 E..4..@[email protected]!4..U.b.=O....e]..... ..F..P.. 09:48:39.751831 IP 172.30.5.150.42324 > 172.23.7.107.8500: Flags [P.], seq 1:130, ack 1, win 507, options [nop,nop,TS val 3448063654 ecr 3914390939], length 129 E.....@[email protected]!4..U.b.=O....e...... ..F..P..GET /v1/catalog/services?wait=60s&index=0 HTTP/1.1 Host: nic-dev:8500 User-Agent: lua-resty-http/0.16.1 (Lua) ngx_lua/10021 09:48:39.751856 IP 172.30.5.150.42324 > 172.23.7.107.8500: Flags [F.], seq 130, ack 1, win 507, options [nop,nop,TS val 3448063654 ecr 3914390939], length 0 E..4..@[email protected]!4..V.b.=O....e]..... ..F..P.. 09:48:39.788270 IP 172.23.7.107.8500 > 172.30.5.150.42324: Flags [.], ack 130, win 493, options [nop,nop,TS val 3914390979 ecr 3448063654], length 0 E..4..@.?......k....!4.Tb.=O..V............ .P....F. 09:48:39.788484 IP 172.23.7.107.8500 > 172.30.5.150.42324: Flags [P.], seq 1:286, ack 130, win 493, options [nop,nop,TS val 3914390980 ecr 3448063654], length 285 E..Q..@.?......k....!4.Tb.=O..V......7..... .P....F.HTTP/1.1 200 OK Content-Type: application/json Vary: Accept-Encoding X-Consul-Default-Acl-Policy: allow X-Consul-Effective-Consistency: leader X-Consul-Index: 13137246 X-Consul-Knownleader: true X-Consul-Lastcontact: 0 Date: Fri, 14 Apr 2023 08:11:14 GMT Content-Length: 914 09:48:39.788497 IP 172.30.5.150.42324 > 172.23.7.107.8500: Flags [R], seq 3973142033, win 0, length 0 E..(..@[email protected]!4..V.....P...A>.. 09:48:39.789107 IP 172.23.7.107.8500 > 172.30.5.150.42324: Flags [F.], seq 286, ack 131, win 493, options [nop,nop,TS val 3914390980 ecr 3448063654], length 0 E..4..@.?......k....!4.Tb.>l..V............ .P....F. 09:48:39.789127 IP 172.30.5.150.42324 > 172.23.7.107.8500: Flags [R], seq 3973142034, win 0, length 0 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
