Skip to content

Commit

Permalink
fix: keep healthcheck target state when upstream changes (apache#10312)
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyDluffy6017 authored and Revolyssup committed Oct 24, 2023
1 parent 8d1fc5b commit 7f1ce59
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
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
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
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 7f1ce59

Please sign in to comment.