Skip to content

Commit

Permalink
fix: keep healthcheck target state when upstream changes (#10312)
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyDluffy6017 authored Oct 13, 2023
1 parent 3f535ad commit 6fa5a89
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apisix/core/config_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function _M.fire_all_clean_handlers(item)
clean_handler.f(item)
end

item.clean_handlers = nil
item.clean_handlers = {}
end


Expand Down
2 changes: 1 addition & 1 deletion apisix/upstream.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ _M.set = set_directly
local function release_checker(healthcheck_parent)
local checker = healthcheck_parent.checker
core.log.info("try to release checker: ", tostring(checker))
checker:clear()
checker:delayed_clear(3)
checker:stop()
end

Expand Down
4 changes: 2 additions & 2 deletions t/node/healthcheck-leak-bugfix.t
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ __DATA__
local new = healthcheck.new
healthcheck.new = function(...)
local obj = new(...)
local clear = obj.clear
obj.clear = function(...)
local clear = obj.delayed_clear
obj.delayed_clear = function(...)
ngx.log(ngx.WARN, "clear checker")
return clear(...)
end
Expand Down

0 comments on commit 6fa5a89

Please sign in to comment.