Skip to content

fix(healthcheck): use immediate clear() to ensure k8s endpoint change…#13029

Open
tyq010101 wants to merge 1 commit intoapache:masterfrom
tyq010101:fix/k8s_ipaddress_no_update
Open

fix(healthcheck): use immediate clear() to ensure k8s endpoint change…#13029
tyq010101 wants to merge 1 commit intoapache:masterfrom
tyq010101:fix/k8s_ipaddress_no_update

Conversation

@tyq010101
Copy link

@tyq010101 tyq010101 commented Feb 25, 2026

…s take effect

Replace delayed_clear() with immediate clear() in healthcheck_manager to fix an issue where k8s endpoint changes would not take effect immediately. The delayed clear could cause healthcheck to continue using stale IP addresses after endpoint updates.

Description

Which issue(s) this PR fixes:

Fixes #

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)

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Feb 25, 2026
…s take effect

Replace delayed_clear() with immediate clear() in healthcheck_manager to fix
an issue where k8s endpoint changes would not take effect immediately. The
delayed clear could cause healthcheck to continue using stale IP addresses
after endpoint updates.
Old K8s Endpoint ip has destroyed, but healthCheck manager always check old ip address
@tyq010101 tyq010101 force-pushed the fix/k8s_ipaddress_no_update branch from 03b48d9 to 3af6251 Compare February 25, 2026 03:24
@tyq010101
Copy link
Author

tyq010101 commented Feb 25, 2026

#12803
I think this pr can fix this issue @Baoyuantop

@Baoyuantop
Copy link
Contributor

The current method of clearing all data causes a temporary loss of health status with each upstream configuration update. The correct approach is to precisely remove nodes that no longer exist in the new upstream configuration. This clears the old stale IPs while preserving the historical health status of unchanged nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants