Skip to content

[Bugfix][Router] Remove ghost endpoint on evicted-worker MODIFIED event#1012

Open
jiawen7777 wants to merge 1 commit into
vllm-project:mainfrom
jiawen7777:fix/ghost-ip-evicted-worker
Open

[Bugfix][Router] Remove ghost endpoint on evicted-worker MODIFIED event#1012
jiawen7777 wants to merge 1 commit into
vllm-project:mainfrom
jiawen7777:fix/ghost-ip-evicted-worker

Conversation

@jiawen7777

Copy link
Copy Markdown

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


  • Make sure the code changes pass the pre-commit checks.
  • Sign-off your commit by using -s when doing git commit
  • Try to classify PRs for easy understanding of the type of changes, such as [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 the vllm_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:

  • Pass all linter checks. Please use pre-commit to format your code. See README.md for installation.
  • The code need to be well-documented to ensure future contributors can easily understand the code.
  • Please include sufficient tests to ensure the change is stay correct and robust. This includes both unit tests and integration tests.

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 -s with git commit will 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.

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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: router keeps a ghost endpoint after a worker pod is evicted, causing request timeouts

1 participant