Baoyuantop commented on PR #13029:
URL: https://github.com/apache/apisix/pull/13029#issuecomment-4241027973
I traced the history of delayed_clear usage:
1. PR #10312 (2023-10-13) originally changed clear() → delayed_clear(3) to
fix a race condition: when upstream config changes, clear() immediately removes
all targets from shared dict, causing concurrent requests to fail when looking
up healthy nodes.
2. PR #12426 (2025-08-07) increased the timeout to 10s when refactoring
healthcheck to async timer-driven architecture, since checker creation now
takes longer.
Therefore, `delayed_clear` cannot be changed to `clear()`, otherwise the
problem in #10312 will continue to occur. The correct practice on the
Kubernetes side is to configure a `preStop` hook — ensuring that the pod does
not exit before the healthcheck response, which is Kubernetes best practice.
Therefore, I will close this PR for now. If you still have this problem, you
can submit an issue first. Thank you for your contribution.
--
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]