openresty / meta-lua-nginx-module

Meta Lua Nginx Module supporting both Http Lua Module and Stream Lua Module
66 stars 20 forks source link

improve: checking ev->pending_eof before peeking data from tcp buffer #69

Open tokers opened 5 years ago

tokers commented 5 years ago

See the relevant issue: https://github.com/openresty/stream-lua-nginx-module/issues/167 for details.

spacewander commented 5 years ago

Look like the original ngx_http_lua_check_broken_connection is modified from ngx_http_upstream_check_broken_connection in 2012. In 2013, Nginx added the NGX_USE_EPOLL_EVENT check to fix https://trac.nginx.org/nginx/ticket/320. However, this code doesn't synchronize the fix.

agentzh commented 5 years ago

So ngx_http_lua_module also needs a patch.

tokers commented 5 years ago

So ngx_http_lua_module also needs a patch.

OK, I will push a patch to that repo.

tokers commented 5 years ago

Look like the original ngx_http_lua_check_broken_connection is modified from ngx_http_upstream_check_broken_connection in 2012. In 2013, Nginx added the NGX_USE_EPOLL_EVENT check to fix https://trac.nginx.org/nginx/ticket/320. However, this code doesn't synchronize the fix.

Sorry, I can't capture the words. What means of "this code doesn't synchronize the fix"? This patch mainly referenced from ngx_http_upstream_check_broken_connection.

spacewander commented 5 years ago

@tokers ngx_http_lua_check_broken_connection doesn't have this patch because it is written in 2012, while this patch is added to ngx_http_lua_check_broken_connection in 2013.

tokers commented 5 years ago

@tokers ngx_http_lua_check_broken_connection doesn't have this patch because it is written in 2012, while this patch is added to ngx_http_lua_check_broken_connection in 2013.

OK 👌