openresty / lua-resty-upstream-healthcheck

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

bad local #16

Closed Tieske closed 5 years ago

Tieske commented 8 years ago

The nthrvariable here; https://github.com/openresty/lua-resty-upstream-healthcheck/blob/master/lib/resty/upstream/healthcheck.lua#L322

Should not be a local. It shadows the outer scope. as such the check slightly further down, where we wait for all spawned threads to finish will never run, because the outer scoped nthr will still be nil.

doujiang24 commented 8 years ago

@Tieske Nice catch :)

Tieske commented 8 years ago

It gave me a nasty sync issue, took me an hour and a half to track it down. I'll try a PR once I'm done with my current stuff

agentzh commented 8 years ago

@Tieske Thanks for the report! Will you please create a PR with a corresponding test case for it? Thanks!

thibaultcha commented 5 years ago

Just opened #59 which comes with a test case and additional fixes.