meta-lua-nginx-module icon indicating copy to clipboard operation
meta-lua-nginx-module copied to clipboard

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

Open tokers opened this issue 6 years ago • 7 comments

tokers avatar Jun 30 '19 07:06 tokers

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

tokers avatar Jun 30 '19 07:06 tokers

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.

spacewander avatar Jun 30 '19 13:06 spacewander

So ngx_http_lua_module also needs a patch.

agentzh avatar Jul 01 '19 02:07 agentzh

So ngx_http_lua_module also needs a patch.

OK, I will push a patch to that repo.

tokers avatar Jul 01 '19 03:07 tokers

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.

tokers avatar Jul 01 '19 03:07 tokers

@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.

spacewander avatar Jul 01 '19 05:07 spacewander

@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 👌

tokers avatar Jul 01 '19 05:07 tokers