Skip to content

[Bugfix]: Authenticate worker health checks - #225

Open
StevenWang-CY wants to merge 1 commit into
vllm-project:mainfrom
StevenWang-CY:fix-worker-health-auth
Open

[Bugfix]: Authenticate worker health checks#225
StevenWang-CY wants to merge 1 commit into
vllm-project:mainfrom
StevenWang-CY:fix-worker-health-auth

Conversation

@StevenWang-CY

Copy link
Copy Markdown

Purpose

Fixes #159.

--api-key is defined as the credential used to authorize requests to workers. The regular router did not attach it to worker health requests. An authenticated worker therefore returned 401 during the startup gate, causing the router to time out before becoming ready. Health checks issued after registration had the same omission and could later mark the worker unhealthy.

This change applies the configured bearer token to every regular-router health path:

  • the initial worker readiness gate;
  • direct health forwarding and dynamic worker registration;
  • recurring health checks performed through BasicWorker, including DP-aware workers.

Workers remain unauthenticated by default, and the existing public wait_for_healthy_workers signature retains its behavior. The credential is held in a private field and omitted from the worker's custom Debug output.

Test Plan

The regression tests run an in-process Axum worker whose /health endpoint accepts only the exact configured bearer token. They cover initial startup, invalid-key rejection, direct health forwarding, dynamic registration, credential retention for recurring checks, and secret redaction. Existing tests continue to cover workers without authentication and DP-aware URL handling.

Test Result

On the unmodified main commit, the authenticated-startup regression timed out waiting for the local worker. With this change, all local validation passed on macOS arm64 with Rust 1.95.0, matching the compiler version in Buildkite:

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --lib --bins: 489 passed
  • cargo test --test '*': 180 passed
  • pre-commit run --files src/core/worker.rs src/routers/http/router.rs

Signed-off-by: StevenWang-CY <203932027+StevenWang-CY@users.noreply.github.com>
@StevenWang-CY

Copy link
Copy Markdown
Author

@Prowindy, could you review and approve this fix for #159? It propagates the configured worker bearer token through startup readiness, direct and registered health forwarding, and recurring BasicWorker checks, while preserving unauthenticated defaults and redacting the credential from Debug output. DCO and Buildkite are green; local validation passed formatting, Clippy with warnings denied, 489 library and binary tests, and 180 integration tests. I will address any findings promptly.

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]: --api-key is not applied to worker health checks

1 participant