Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3810b631d7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Balance new sessions by active-session count while preserving existing affinity, with explicit release and idle expiry. Wire the policy through configuration, typed request bodies, and discovered prefill/decode headers. Adapt the public Apache-2.0 implementation by SumanthRH from SumanthRH@b50d926 and add parser, expiry, concurrent admission, and HTTP routing regressions. (cherry picked from commit b50d926) Signed-off-by: bvolpato <brunocvcunha@gmail.com>
Signed-off-by: bvolpato <brunocvcunha@gmail.com>
6057976 to
6422afa
Compare
Balance new sessions by active-session count while preserving existing affinity, with explicit release and idle expiry. Preserve legacy session identifiers and wire the policy through regular and prefill/decode routing. Squashes vllm-project#235 commits a06430d and 6422afa, with the fork-specific run_id test argument adaptation. The implementation was adapted upstream from SumanthRH/router commit b50d926. Signed-off-by: bvolpato <brunocvcunha@gmail.com>
Balance new sessions by active-session count while preserving existing affinity, with explicit release and idle expiry. Preserve legacy session identifiers and wire the policy through regular and prefill/decode routing. Squashes vllm-project#235 commits a06430d and 6422afa, with the fork-specific run_id test argument adaptation. Upgrade runtime image packages so the container includes current Debian security fixes. The implementation was adapted upstream from SumanthRH/router commit b50d926. Signed-off-by: bvolpato <brunocvcunha@gmail.com>
Balance new sessions by active-session count while preserving existing affinity, with explicit release and idle expiry. Preserve legacy session identifiers and wire the policy through regular and prefill/decode routing. Squashes vllm-project#235 commits a06430d and 6422afa. The implementation was adapted upstream from SumanthRH/router commit b50d926. Signed-off-by: bvolpato <brunocvcunha@gmail.com>
hsliuustc0106
left a comment
There was a problem hiding this comment.
Reviewed at f2ae9ea4. This is the complete version of the sticky-session design (relevant given the overlap with #306, whose own TODO cites this approach):
- TTL expiry (2 h default,
VLLM_ROUTER_SLL_SESSION_EXPIRATION_IN_S) with sweeps bounded to once per 60 s under the lock. - Selection + recording are atomic under one mutex, so concurrent new sessions can't all observe the same free capacity; rendezvous hashing gives deterministic tie-breaks.
- Header-less requests are load-balanced without being recorded as sessions —
extract_session_idreturnsNoneinstead of falling back to hashing the request body, avoiding the per-prompt map-growth problem. /finish_sessionis properly behindauthorize_request.
One documentation note (P3): the idle TTL silently breaks stickiness for sessions whose turns are more than 2 hours apart — sticky KV-cache reuse quietly degrades and the session may be reassigned. It's tunable, but worth stating in user-facing docs.
Process note: the branch predates the #283 merge (touches protocols/spec.rs and hash_key.rs), so expect a routine rebase. No findings beyond that.
From an automated daily review pass over new/updated PRs (head SHA frozen at f2ae9ea4).
Purpose
Add opt-in
sticky_least_loadedrouting for multi-turn workloads. New sessions reserve the healthy worker with the fewest active sessions, with deterministic rendezvous tie-breaking. Existing sessions keep their worker until explicit release, idle expiry, or worker unavailability. Selection and reservation share one mutex so concurrent arrivals do not all observe the same free capacity.This addresses the session-policy gap described in NovaSky-AI/SkyRL#2070. It balances active sessions, not concurrent requests, queued tokens, or GPU utilization.
POST /finish_session?session_id=..., with idempotent release across registered policies. Check revisited sessions for expiry before renewing their affinity.Adapted from the public Apache-2.0 implementation in SumanthRH/router@b50d926. The existing license is preserved. AI assistance was used for adaptation and regression coverage.
This change does not retire the downstream fork by itself. Migration still needs the typed routing paths in #199, consolidated request-accounting/response-lifetime work from #200/#216 (including #215/#176), and the endpoint cancellation work in NovaSky-AI/SkyRL#2121. This PR does not change request-load guards or cancel backend generation.
Test Plan
Run with Rust 1.95 and the compiled Python extension:
Test Result
Downsides
VLLM_ROUTER_SLL_SESSION_EXPIRATION_IN_S. Idle entries are swept on routing requests at most once per minute; a revisited entry is checked immediately. Callers must release finished sessions for prompt balancing.Risk and rollback
Opt-in only; existing policy defaults remain unchanged. To roll back, choose the previous policy and restart the router. No persisted data migration is needed.
Essential Elements of an Effective PR Description Checklist