Skip to content

Commit

Permalink
fix(core): fix balancer stop_healthchecks function table nil panic bug (
Browse files Browse the repository at this point in the history
#12865)

fix balancer stop_healthchecks function unexpected table nil panic
#12811
  • Loading branch information
oowl authored Apr 19, 2024
1 parent 7dd29d4 commit 0a4918d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

1 comment on commit 0a4918d

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:0a4918df771f1190ed5fbbfecf15cb596b0ba24c
Artifacts available https://github.com/Kong/kong/actions/runs/8749897197

Please sign in to comment.