AlinsRan commented on code in PR #13717:
URL: https://github.com/apache/apisix/pull/13717#discussion_r3679176876
##########
apisix/core/config_etcd.lua:
##########
@@ -637,12 +667,35 @@ local function load_full_data(self, dir_res, headers)
if self.filter then
self.filter(item)
end
+
+ else
+ local prev_item = get_prev_item(prev_values, prev_values_hash,
key)
+ if prev_item then
+ -- keep serving with the last valid configuration instead
of
+ -- silently dropping the whole item on a full reload, see
the
+ -- incremental path in sync_data for the same semantics
+ log.warn("failed to check item data of [", self.key, "/",
key,
+ "], keep the previous configuration, err: ", err)
+ insert_tab(self.values, prev_item)
+ self.values_hash[key] = #self.values
+ carried[prev_item] = true
+ end
end
self:upgrade_version(item.modifiedIndex)
end
end
+ -- fire the clean handlers of the previous items that were not carried
+ -- over: they were either replaced by a new value or deleted from etcd
+ if prev_values then
+ for _, item in ipairs(prev_values) do
+ if item and not carried[item] then
+ config_util.fire_all_clean_handlers(item)
+ end
+ end
+ end
Review Comment:
Done in #13761 — removes `add_clean_handler` / `cancel_clean_handler` /
`fire_all_clean_handlers` and all fire sites and `clean_handlers`
initializations across the config backends.
--
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]