lua-resty-upstream-healthcheck
lua-resty-upstream-healthcheck copied to clipboard
bad id reference
trafficstars
see https://github.com/openresty/lua-resty-upstream-healthcheck/blob/master/lib/resty/upstream/healthcheck.lua#L282
This line assumes that iterator - 1 equals the id of the peer. That is a bad assumption. It should use peers[iterator].id instead probably to use the true id value provided by the upstream module.
The code has multiple occurrences of this issue.
@Tieske Yeah, the current implementation assumes that the peers list is static and never change (except HUP reload, of course). That's an artificial limitation which should be removed if we want to support dynamic upstreams. So patches welcome :)