kingluo commented on code in PR #9016:
URL: https://github.com/apache/apisix/pull/9016#discussion_r1126316038
##########
apisix/core/config_util.lua:
##########
@@ -88,9 +88,15 @@ function _M.cancel_clean_handler(item, idx, fire)
end
core_tab.remove(item.clean_handlers, pos)
- if fire then
+ if not fire then
Review Comment:
Since we add create_checker guard, `fire` will not be `nil`, so no need to
check `nil` here?
##########
apisix/upstream.lua:
##########
@@ -115,8 +122,11 @@ local function create_checker(upstream)
end
if healthcheck_parent.checker then
- core.config_util.cancel_clean_handler(healthcheck_parent,
+ local ok, err = pcall(core.config_util.cancel_clean_handler,
healthcheck_parent,
Review Comment:
Since we add `create_checker` guard, `cancel_clean_handler` will not fail
anymore, so no need to do `pcall`?
##########
apisix/upstream.lua:
##########
@@ -115,8 +122,11 @@ local function create_checker(upstream)
end
if healthcheck_parent.checker then
Review Comment:
Except for this parallel checker creation bug (due to the non-atomic fact of
checker `new()` and `add_target()`), each resource update from etcd will
replace the old value with a brand new one, here `healthcheck_parent` (the
resource itself) will have only one checker at most anytime, so should we
delete the obsolete code of checker conditions handling?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]