[Bugfix][Router] Remove ghost endpoint on evicted-worker MODIFIED event#1012
Open
jiawen7777 wants to merge 1 commit into
Open
[Bugfix][Router] Remove ghost endpoint on evicted-worker MODIFIED event#1012jiawen7777 wants to merge 1 commit into
jiawen7777 wants to merge 1 commit into
Conversation
When a worker pod is evicted under node pressure, the kubelet clears its
podIP and Kubernetes emits a MODIFIED event with engine_ip=None. On current
main the MODIFIED branch returns early on a None IP, so the already-registered
endpoint lingers as a stale ("ghost") backend. The router keeps routing
requests to that address even though no worker is behind it, and those
requests hang until they time out. The endpoint is only cleared when the
router process restarts.
An empty IP on MODIFIED is ambiguous: a Pending pod has no IP yet (skip it),
but an Evicted pod has had its podIP cleared and its endpoint must be removed.
Remove the registered engine on this path, mirroring the DELETED handling, and
log a WARNING so the removal is observable.
Scope: K8sPodIPServiceDiscovery only; ADDED and graceful-drain paths unchanged;
no routing changes. Adds 5 regression tests.
Signed-off-by: Jiawen Wang <jiawen_wang@u.nus.edu>
Contributor
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where evicted Kubernetes pods with cleared pod IPs could linger as stale ('ghost') endpoints in the service discovery. It updates the _on_engine_update method in K8sPodIPServiceDiscovery to check if a modified pod with a None IP is already registered, and if so, removes it. Additionally, a comprehensive set of unit tests has been added to verify this behavior and ensure regression coverage. I have no feedback to provide on these changes.
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.
When a worker pod is evicted under node pressure, the kubelet clears its podIP and Kubernetes emits a MODIFIED event with engine_ip=None. On current main the MODIFIED branch returns early on a None IP, so the already-registered endpoint lingers as a stale ("ghost") backend. The router keeps routing requests to that address even though no worker is behind it, and those requests hang until they time out. The endpoint is only cleared when the router process restarts.
An empty IP on MODIFIED is ambiguous: a Pending pod has no IP yet (skip it), but an Evicted pod has had its podIP cleared and its endpoint must be removed. Remove the registered engine on this path, mirroring the DELETED handling, and log a WARNING so the removal is observable. This fix has been verified to resolve the problem in real deployment.
Scope: K8sPodIPServiceDiscovery only; ADDED and graceful-drain paths unchanged; no routing changes. Adds 5 regression tests.
FILL IN THE PR DESCRIPTION HERE
FIX #1008
BEFORE SUBMITTING, PLEASE READ THE CHECKLIST BELOW AND FILL IN THE DESCRIPTION ABOVE
-swhen doinggit commit[Bugfix],[Feat], and[CI].Detailed Checklist (Click to Expand)
Thank you for your contribution to production-stack! Before submitting the pull request, please ensure the PR meets the following criteria. This helps us maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Please try to classify PRs for easy understanding of the type of changes. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]for bug fixes.[CI/Build]for build or continuous integration improvements.[Doc]for documentation fixes and improvements.[Feat]for new features in the cluster (e.g., autoscaling, disaggregated prefill, etc.).[Router]for changes to thevllm_router(e.g., routing algorithm, router observability, etc.).[Misc]for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
pre-committo format your code. SeeREADME.mdfor installation.DCO and Signed-off-by
When contributing changes to this project, you must agree to the DCO. Commits must include a
Signed-off-by:header which certifies agreement with the terms of the DCO.Using
-swithgit commitwill automatically add this header.What to Expect for the Reviews
We aim to address all PRs in a timely manner. If no one reviews your PR within 5 days, please @-mention one of YuhanLiu11
, Shaoting-Feng or ApostaC.