refactor(router): harden process-local session placement lifecycle - #11572
Draft
qianlihuang wants to merge 2 commits into
Draft
qianlihuang wants to merge 2 commits into
qianlihuang wants to merge 2 commits into
Conversation
Signed-off-by: qianlihuang <91178480+qianlihuang@users.noreply.github.com>
qianlihuang
temporarily deployed
to
external_collaborator
July 11, 2026 11:25 — with
GitHub Actions
Inactive
qianlihuang
temporarily deployed
to
external_collaborator
July 11, 2026 11:25 — with
GitHub Actions
Inactive
Contributor
|
👋 Hi qianlihuang! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
Signed-off-by: qianlihuang <91178480+qianlihuang@users.noreply.github.com>
qianlihuang
temporarily deployed
to
external_collaborator
July 12, 2026 05:57 — with
GitHub Actions
Inactive
Contributor
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
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.
Overview
Refactors the existing process-local worker session-affinity state behind a crate-private, target-agnostic placement lifecycle coordinator.
This remains a draft foundation for #11403, which is still
dep:draft. It is not the Phase 1 multi-DC Global Router policy: it adds no proxy, public placement API, cross-replica claim, target catalog, base policy, or forwarding path. It preserves the process-local boundary restored by #11217 rather than reintroducing the distributed claims reverted from #11079.Details
ReservedandDispatching, fixes one provisional versioned target before forwarding, and fences completion with an attempt ID and target generation.Accepted,DefinitelyNotAccepted, orAmbiguousoutcomes. Only a definitely-not-accepted attempt rolls back for retry; a timeout or dropped in-flight dispatch guard is quarantined and never silently replayed.Arc, removing theT: Clonerequirement and avoiding caller-owned target clone/drop work while DashMap shards are locked.commit_already_acceptedcompatibility bridge after a response stream has been selected. That bridge is intentionally not the strict pre-dispatch contract for the future Global Router.Intentional integration boundaries
Capacity; the future Global Router adapter must implement DEP: Session-Aware Placement Policy for the Multi-DC Global Router #11403's stateless fallback. Existing worker affinity continues to report its current resource-exhausted behavior.begin_dispatchacross the production network await is deferred until the forwarding layer can classify accepted, definitely-not-accepted, and ambiguous transport/stream outcomes and own recovery. Current worker affinity remains behavior-compatible.Upstream review
Reviewed canonical
mainat0ee5aa6f9a156609863eef62f5decb241f64287c. The only upstream change since this PR's base is #11569 inlib/llm/src/http/service/metrics.rs, which does not overlap this change. #11403 and #11225 remaindep:draft; #11217 remains the process-local boundary, and #11435 remains router-local CKF work rather than Global Router transport/recovery plumbing.Where should the reviewer start?
Start with
lib/llm/src/session_placement/coordinator.rs, especially the dispatch-outcome and ambiguous-state transitions. Then reviewlib/llm/src/session_affinity/coordinator.rsfor the behavior-preserving adapter andlib/llm/src/session_placement/tests.rsfor concurrency and fencing coverage.Validation
cargo fmt --all -- --checkcargo clippy --locked -p dynamo-llm --no-default-features --lib -- -D warningscargo test --locked -p dynamo-llm --no-default-features --lib session_— 60 passedcargo test --locked -p dynamo-llm --no-default-features --lib push_router— 19 passedpre-commit run --files <changed files>Related Issues