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 3 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**: fix balancer stop_healthchecks function unexpected table nil panic"
type: bugfix
scope: Core
6 changes: 5 additions & 1 deletion kong/runloop/balancer/healthcheckers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,11 @@ 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 = upstreams.get_all_upstreams()
if all_upstreams == nil then
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