openresty / lua-resty-upstream-healthcheck

Health Checker for Nginx Upstream Servers in Pure Lua
521 stars 134 forks source link

Why not setkeepalive on tcp socket ? #85

Open NicoAdrian opened 2 years ago

NicoAdrian commented 2 years ago

For each healthcheck, you seem to close the socket, why not put it into the connection pool with sock:setkeepalive() instead ?

https://github.com/openresty/lua-resty-upstream-healthcheck/blob/346f3a642b6717a26382e4032160aa766af0188c/lib/resty/upstream/healthcheck.lua#L275

zhuizhuhaomeng commented 2 years ago

the healthcheck.lua does not parse the full http response, maybe there are some data left in the socket. So we can not put it into the pool