Repository navigation
refactor(router): classifier runtime reports its own error and takes the view - #132
Closed
ishandhanani wants to merge 1 commit into
Closed
ishandhanani wants to merge 1 commit into
ishandhanani wants to merge 1 commit into
Conversation
ishandhanani
had a problem deploying
to
external_collaborator
October 31, 2026 02:32 — with
GitHub Actions
Failure
…the view Step 5e-3 of the router split (DYNO-178). RequestClassifierRuntime no longer names KvSchedulerError: classify_with, begin_request, and the terminal-delivery wait return ClassificationError, with one variant per failure the runtime can detect (Panicked, Failed, DuplicateRequestId, InvalidMetadata, LifecycleEnded, Shutdown) and the same messages the kernel's variants carried. The kernel converts with From<ClassificationError> for KvSchedulerError, so its error surface, the selection service's status mapping, and every host path are unchanged. classify_with takes `&dyn WorkerView`; the scheduler wraps the rows it built in ClassifierRows at its two call sites, and the runtime's tests classify over the empty view. WorkerView gains a Sync supertrait: views are read-only snapshots, and a classification future that borrows one must stay Send for spawned callers. Validation: kv-router 554 + 2 + 7; builtin plugin all targets; lib/llm kv_router 485 and discovery watcher 36; clippy clean on kv-router, builtin, lib/llm, mocker, ext-proc, bench; downstream check clean; layering gate 22 checks; move-diff 3,788 common / 91 new / 64 dropped. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/dyn-178-classification-error
branch
from
November 2, 2026 13:30
45a8f95 to
5b8c1f3
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 2, 2026 13:30 — with
GitHub Actions
Failure
Owner
Author
|
Landed upstream as ai-dynamo#18055 (squash commit 79692cf on main, 2026-11-11). Closing this fork review unit. |
This branch had an error being deployed
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.
Step 5e-3 of the router split v2 (DYNO-178). Stacked on #131. Behavior-preserving; the last boundary change before the admission crate move.
Summary
ClassificationError. The classifier runtime (scheduling/request_classifier.rs, moving todynamo-admissionin 5e-4) stops naming the kernel'sKvSchedulerError.classify_with,begin_request, and the terminal-delivery wait returnClassificationError::{Panicked(String), Failed(Arc<ClassifierError>), DuplicateRequestId(String), InvalidMetadata(String), LifecycleEnded(String), Shutdown}, with the messages the kernel's variants carried (Shutdownsays "request classifier runtime shut down"; the kernel'sSubscriberShutdownkeeps its own text).impl From<ClassificationError> for KvSchedulerErrorinscheduling/types.rsmaps each variant to the existing one (RequestClassifierPanicked,RequestClassifierFailed,DuplicateClassificationRequestId,InvalidClassificationMetadata,ClassificationLifecycleEnded,SubscriberShutdown), so the kernel's error surface, the selection service's HTTP status mapping, lib/llm's abort-cause mapping, and the Python bindings are untouched. The scheduler's two call sites addmap_err(KvSchedulerError::from).classify_with(&dyn WorkerView). The runtime takes the view; the scheduler wraps its freshly built rows inClassifierRows(introduced in refactor(router): classifiers read workers through an admission-owned view #130) at the call site, and the runtime's own tests classify overNoWorkers. The view is lent for the synchronousclassifycall as before.WorkerView: Sync. Views are read-only snapshots. A classification future borrowing&dyn WorkerViewacross the classifier-lock await must staySendfor spawned callers (the selection service's handlers andtokio::spawned selections), which&dyn WorkerViewis only when the trait object isSync.ClassificationErroris exported atscheduling::ClassificationErrorbesideRequestLifecycle.Validation
cargo test -p dynamo-kv-router --features standalone-selection,standalone-slot-tracker,metrics,testing: 554 + 2 + 7 passed (the runtime's tests now assertClassificationErrorvariants).cargo test -p dynamo-custom-policy-builtin --all-features: 56 + 5 + 1 + 3 + 20 + 3 + 4 passed.cargo test -p dynamo-llm kv_router: 485 passed;cargo test -p dynamo-llm --lib watcher: 36 passed.cargo clippy --all-features --all-targets -D warningson kv-router, builtin: clean;cargo clippy --tests -D warningson lib/llm (default features), mocker, ext-proc, bench: clean;cargo check --testson lib/llm, mocker, bench, sglang-sidecar, ext-proc: clean.scripts/router_layering_check.sh: 22 checks, 0 failures.scripts/router_move_diff.py f832286531 WORKTREEoverscheduling/{request_classifier,local,types,mod}.rsandplugins/request_classifier/view.rs: 3,788 common / 91 new / 64 dropped. New: the error enum, theFromimpl, the view parameter and the two call-site wraps,NoWorkersin the runtime tests, theSyncbound. Dropped: theKvSchedulerErrorvariant constructions and signatures in the runtime, theWorkerInputRows::empty()arguments, and the in-runtimeClassifierRowswrap.