Skip to content

Commit

Permalink
fix(balancers) stop health check when recreating balancer (#7549)
Browse files Browse the repository at this point in the history
  • Loading branch information
locao authored Jul 28, 2021
1 parent 003c34a commit be4911a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions kong/runloop/balancer/balancers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,13 @@ end
-- @param recreate (boolean, optional) create new balancer even if one exists
-- @return The new balancer object, or nil+error
function balancers_M.create_balancer(upstream, recreate)
if balancers_by_id[upstream.id] and not recreate then
return balancers_by_id[upstream.id]
local existing_balancer = balancers_by_id[upstream.id]
if existing_balancer then
if recreate then
healthcheckers.stop_healthchecker(existing_balancer)
else
return existing_balancer
end
end

if creating[upstream.id] then
Expand Down

0 comments on commit be4911a

Please sign in to comment.