lua-nginx-module
lua-nginx-module copied to clipboard
About cosocket:settimeouts doesn't work when i use cosocket:receive
About cosocket:settimeouts doesn't work when i use cosocket:receive If I connect to the server but I don't send any data
code: preread_by_lua_block {
local sock = ngx.req.socket()
sock:settimeouts(3*1000, 3*1000, 3*1000)
ngx.log(ngx.ERR,"start receive")
local data, err = sock:receive(5)
if not data then
ngx.log(ngx.ERR,"receive err:",err)
else
ngx.log(ngx.ERR,"receive data:",data)
end
}
$ openresty -V nginx version: openresty/1.21.4.1 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) built with OpenSSL 1.1.1o 3 May 2022
If I don't send any data, the connection will always be maintained, and if I go through the public transmission and filter the tcp hang request ACK, it will cause the server connection count to skyrocket
This seems to be a bug. you can install the openresty-debug, and set the error log level to debug for future debugging.