Skip to content

fix: refresh worker models every 20 seconds by default - #58

Merged
mikasenghaas merged 2 commits into
mainfrom
fix/refresh-models-on-health-recovery
Sep 29, 2026
Merged

mikasenghaas merged 2 commits into
mainfrom
fix/refresh-models-on-health-recovery

Conversation

@S1ro1

@S1ro1 S1ro1 commented Sep 27, 2026 •

Copy link
Copy Markdown

Workers that are still loading during startup can be indexed under unknown and receive no model-filtered traffic until model discovery runs again. Refresh /v1/models on every runtime health-check cycle instead of every fifth cycle, and lower the default cycle interval from 60 to 20 seconds.

The six-line change updates the Rust config, Rust CLI, Python binding and Python CLI defaults, the documented default, and the model refresh interval. Existing filtering to healthy workers and deduplication by DP base URL remain in place. Explicit interval overrides still work; unhealthy workers still need to meet the existing health recovery threshold before model discovery runs.

Validation: git diff origin/main --check passed. Executed checks for the Python configuration default, CLI default, and an explicit CLI interval override; all passed. Rust build and tests were not run because this environment has no Rust toolchain.


Note

Low Risk
Default timing and background polling only; explicit health_check_interval_secs overrides still apply and routing logic is unchanged aside from fresher model indexes.

Overview
Speeds up worker model discovery so workers are not stuck under unknown and excluded from model-filtered routing while they finish loading.

Default runtime health-check interval is lowered from 60s to 20s across Rust config/CLI, Python RouterArgs/docs, and PyO3 binding defaults. In the registry health checker, MODEL_REFRESH_INTERVAL goes from 5 to 1, so /v1/models refresh runs on every health-check cycle instead of every fifth cycle (with healthy-worker filtering and DP base-URL dedup unchanged).

Reviewed by Cursor Bugbot for commit 6bb5701. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Change default health-check interval from 60 to 20 seconds

Updates the default for health_check_interval_secs from 60 to 20 across the Python dataclass, PyO3 constructor, Rust HealthCheckConfig default, and CLI args. Also updates the Router class docs. The model-refresh interval inside WorkerRegistry.start_health_checker changes from 5 seconds to 1 second.

  • Behavioral Change: routers built without an explicit interval now run the health check every 20 seconds; the health-check task refreshes worker models every 1 second — see worker_registry.rs and router_args.py.
📊 Macroscope summarized 6bb5701. 6 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

@S1ro1 S1ro1 changed the title fix: refresh worker models on health recovery fix: refresh worker models every 20 seconds by default Sep 27, 2026
@mikasenghaas
mikasenghaas marked this pull request as ready for review September 29, 2026 01:22
let handle = tokio::spawn(async move {
const LOAD_RESET_INTERVAL: u64 = 10;
const MODEL_REFRESH_INTERVAL: u64 = 5;
const MODEL_REFRESH_INTERVAL: u64 = 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High core/worker_registry.rs:477

Health checks are continuously delayed when multiple /v1/models requests stall, so failed workers can remain marked healthy and continue receiving traffic. With MODEL_REFRESH_INTERVAL set to 1, every health-check cycle performs sequential discovery requests, each potentially taking five seconds; restore the less frequent refresh interval (or decouple discovery from health checks).

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @src/core/worker_registry.rs around line 477:

Health checks are continuously delayed when multiple `/v1/models` requests stall, so failed workers can remain marked healthy and continue receiving traffic. With `MODEL_REFRESH_INTERVAL` set to `1`, every health-check cycle performs sequential discovery requests, each potentially taking five seconds; restore the less frequent refresh interval (or decouple discovery from health checks).

@macroscopeapp

macroscopeapp Bot commented Sep 29, 2026

Copy link
Copy Markdown

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR changes production health-check and model-discovery cadence, causing every default health cycle to perform potentially slow sequential /v1/models requests. That coupling can affect failure detection and traffic routing under stalled workers, so the runtime impact needs careful validation.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@mikasenghaas
mikasenghaas merged commit 263ec8c into main Sep 29, 2026
9 checks passed
mikasenghaas added a commit that referenced this pull request Sep 29, 2026
Release the faster worker model refresh from #58.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mikasenghaas mikasenghaas mentioned this pull request Sep 29, 2026
mikasenghaas added a commit that referenced this pull request Sep 29, 2026
Release the faster worker model refresh from #58.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
mikasenghaas added a commit to PrimeIntellect-ai/prime-rl that referenced this pull request Sep 29, 2026
## Summary

- Bump `vllm-router` from 0.2.1 to
[0.2.2](https://github.com/PrimeIntellect-ai/router/releases/tag/v0.2.2)
(amd64 and arm64 release wheels).
- The new router picks up PrimeIntellect-ai/router#58. The default
health-check interval drops from 60s to 20s, and every health-check
cycle refreshes `/v1/models`. Workers that are still loading at startup
no longer stay under `unknown` and miss model-filtered traffic for
minutes.

## Verification

- `uv lock` resolves with `vllm-router v0.2.1 -> v0.2.2`.
- Installed router reports version `0.2.2` and
`RouterArgs.health_check_interval_secs == 20`.
- Ran 5 steps of `configs/basic/reverse-text/rl.toml` single-node on
SLURM (H200) through the router: 5/5 steps, 0% rollout errors, no
tracebacks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches the disaggregated inference routing dependency only, but the
new router changes health-check timing and worker/model discovery
behavior on the critical vLLM serving path.
> 
> **Overview**
> Upgrades the pinned **`vllm-router`** wheels from **0.2.1** to
**0.2.2** for Linux **x86_64** and **aarch64** in `pyproject.toml`, with
matching **`uv.lock`** updates (version, download URLs, and wheel
hashes).
> 
> Installs that use the **`disagg`** extra (and related GPU/disagg
resolution paths) will pull the new router release instead of 0.2.1. No
in-repo application code changes—only dependency resolution.
> 
> The **0.2.2** router (PrimeIntellect-ai/router#58) shortens the
default health-check interval (**60s → 20s**), refreshes
**`/v1/models`** on each health cycle, and avoids workers staying
**`unknown`** while still loading at startup (so model-filtered traffic
is not skipped for long periods).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f8087ad. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants