Skip to content

chore(core): remove the dead clean_handlers mechanism - #13761

Merged
AlinsRan merged 1 commit into
masterfrom
chore/remove-clean-handlers
Jul 30, 2026
Merged

chore(core): remove the dead clean_handlers mechanism#13761
AlinsRan merged 1 commit into
masterfrom
chore/remove-clean-handlers

Conversation

@AlinsRan

Copy link
Copy Markdown
Contributor

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 every fire_all_clean_handlers() call a no-op and every item.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: drop add_clean_handler, cancel_clean_handler, fire_all_clean_handlers
  • config_etcd / config_yaml / config_xds: drop the fire sites and the clean_handlers initialization
  • plugin.lua: drop the field from the dummy global rule
  • control/v1.lua: drop the field from the routes/services dump
  • docs: drop the stale clean_handlers entries from the control API response samples
  • t/core/config_util.t: drop the test that only covered the removed API

No behavior change — the removed code paths were unreachable.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (if not, please discuss on the APISIX mailing list first)

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
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. tech debt labels Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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, and fire_all_clean_handlers from apisix.core.config_util.
  • Dropped clean_handlers initialization 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.

@membphis membphis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlinsRan
AlinsRan merged commit 59558be into master Jul 30, 2026
31 checks passed
@AlinsRan
AlinsRan deleted the chore/remove-clean-handlers branch July 30, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files. tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants