feat(router): add sticky least-loaded session routing - #235
Open
bvolpato wants to merge 2 commits into
Open
Conversation
bvolpato
marked this pull request as ready for review
September 3, 2026 04:22
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>
bvolpato
force-pushed
the
bv/sticky-least-loaded
branch
from
September 10, 2026 04:40
6057976 to
6422afa
Compare
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.
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