lua-resty-upstream-healthcheck icon indicating copy to clipboard operation
lua-resty-upstream-healthcheck copied to clipboard

bad id reference

Open Tieske opened this issue 9 years ago • 1 comments
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 avatar Mar 14 '16 15:03 Tieske

@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 :)

agentzh avatar Mar 14 '16 21:03 agentzh