Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): fix balancer stop_healthchecks function table nil panic bug #12865

Merged
merged 6 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: "**Core**: Fixed unexpected table nil panic in the balancer's stop_healthchecks function"
type: bugfix
scope: Core
7 changes: 6 additions & 1 deletion kong/runloop/balancer/healthcheckers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,12 @@ end
-- the health checker, this parameter is useful to avoid throwing away current
-- health status.
function healthcheckers_M.stop_healthcheckers(delay)
for _, id in pairs(upstreams.get_all_upstreams()) do
local all_upstreams, err = upstreams.get_all_upstreams()
if err then
log(ERR, "[healthchecks] failed to retrieve all upstreams: ", err)
return
end
for _, id in pairs(all_upstreams) do
local balancer = balancers.get_balancer_by_id(id)
if balancer then
healthcheckers_M.stop_healthchecker(balancer, delay)
Expand Down
Loading