chore(core): remove the dead clean_handlers mechanism - #13761
Merged
Conversation
After #12426 moved health checks to `healthcheck_manager`, nothing calls `config_util.add_clean_handler()` any more, so every `fire_all_clean_handlers()` call is a no-op and every `item.clean_handlers = {}` initialization is dead weight on the config items. Remove the whole mechanism uniformly: - drop `add_clean_handler`, `cancel_clean_handler` and `fire_all_clean_handlers` from `core.config_util` - drop the fire sites and the `clean_handlers` initialization from `config_etcd`, `config_yaml` and `config_xds` - drop the field from the dummy global rule in `plugin.lua` and from the control API dump in `control/v1.lua` - drop the stale `clean_handlers` entries from the control API doc samples and the unit test that only covered the removed API
nic-6443
approved these changes
Jul 30, 2026
shreemaan-abhishek
approved these changes
Jul 30, 2026
There was a problem hiding this comment.
🟢 Ready to approve
The removed APIs/fields have no remaining references in the codebase and the updates are consistently applied across runtime config backends, control output shaping, docs, and tests.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Removes the now-dead clean_handlers mechanism from APISIX core configuration objects. Since health checks were moved to healthcheck_manager, no runtime config item registers clean handlers anymore, making handler initialization and firing sites unreachable and unnecessary.
Changes:
- Removed
add_clean_handler,cancel_clean_handler, andfire_all_clean_handlersfromapisix.core.config_util. - Dropped
clean_handlersinitialization and all fire sites from config backends (etcd/yaml/xds) and related objects. - Updated Control API output shaping + docs samples, and removed the unit test that only covered the deleted API.
File summaries
| File | Description |
|---|---|
apisix/core/config_util.lua |
Removes the clean-handler API surface from the utility module. |
apisix/core/config_etcd.lua |
Removes clean-handler initialization/firing in etcd config sync paths. |
apisix/core/config_yaml.lua |
Removes clean-handler initialization/firing in YAML config sync paths. |
apisix/core/config_xds.lua |
Removes clean-handler initialization/firing in xDS config sync paths. |
apisix/plugin.lua |
Drops clean_handlers from the dummy global rule object. |
apisix/control/v1.lua |
Stops explicitly stripping clean_handlers from dumped routes/services. |
docs/en/latest/control-api.md |
Removes clean_handlers from Control API response examples. |
t/core/config_util.t |
Removes the test that only exercised the deleted clean-handler API. |
t/core/config_etcd.t |
Updates test fixture data to no longer include clean_handlers. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 0
- Review effort level: Low
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #13717 (comment).
After #12426 moved health checks to
healthcheck_manager, nothing registers a clean handler any more:config_util.add_clean_handler()has no caller outside its own unit test. That makes everyfire_all_clean_handlers()call a no-op and everyitem.clean_handlers = {}initialization dead weight on each config item.This removes the mechanism uniformly instead of dropping it from one config backend only:
core.config_util: dropadd_clean_handler,cancel_clean_handler,fire_all_clean_handlersconfig_etcd/config_yaml/config_xds: drop the fire sites and theclean_handlersinitializationplugin.lua: drop the field from the dummy global rulecontrol/v1.lua: drop the field from the routes/services dumpclean_handlersentries from the control API response samplest/core/config_util.t: drop the test that only covered the removed APINo behavior change — the removed code paths were unreachable.
Checklist