chore: Upgrade Rust to latest stable, 1.96.1 - #11260
Conversation
New lints:
- `zip` takes things that implement `IntoIter` so the `.into_iter()`
calls were unnecessary.
- `sort_by_key` is typically more efficient than `sort_by`.
- Use `checked_div` removes the need to check divisor is not 0.
- Use `while let ..` instead of `loop { let ..`
Signed-off-by: Graham King <grahamk@nvidia.com>
WalkthroughThis PR bumps the pinned Rust toolchain from 1.93.1 to 1.96.1 across container Dockerfiles, Makefiles, rust-toolchain.toml files, and documentation. It also applies a batch of clippy-suggested refactors: checked_div for safe division, sort_by_key replacing sort_by, zip without into_iter(), while-let loop rewrites, and a clippy allow attribute. ChangesRust Toolchain Bump
Clippy-Driven Code Refactors
Estimated code review effort: 2 (Simple) | ~15 minutes Suggested labels: dependencies, rust-toolchain, clippy Suggested reviewers: Rust maintainers familiar with kv-router, kvbm-engine, and llm aggregator modules Poem: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/kv-router/src/indexer/pruning.rs (1)
579-616: 🩺 Stability & Availability | 🔴 Critical | 🏗️ Heavy liftSelf-deadlock in
queue_due
expiriesstays live for the whole loop iteration, sopush_worker_expiry()can re-lockself.next_expirieswhile that mutex is still held and hang the pruning worker. Scope the heap lock to a smaller block before touching per-worker state or callingpush_worker_expiry().🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/kv-router/src/indexer/pruning.rs` around lines 579 - 616, `queue_due` can self-deadlock because the `next_expiries` mutex stays held across the whole loop iteration while `push_worker_expiry()` may try to lock it again. Narrow the lifetime of the `expiries` guard in `queue_due` so the heap lock is released before accessing `self.workers`, `state.pop_expired`, or calling `push_worker_expiry()`, keeping only the minimal critical section around peek/pop.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@lib/kv-router/src/indexer/pruning.rs`:
- Around line 579-616: `queue_due` can self-deadlock because the `next_expiries`
mutex stays held across the whole loop iteration while `push_worker_expiry()`
may try to lock it again. Narrow the lifetime of the `expiries` guard in
`queue_due` so the heap lock is released before accessing `self.workers`,
`state.pop_expired`, or calling `push_worker_expiry()`, keeping only the minimal
critical section around peek/pop.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4d6ded8f-bfe1-4a12-9deb-1e97bbb7e967
📒 Files selected for processing (27)
container/templates/dynamo_base.Dockerfiledeploy/inference-gateway/epp/Dockerfiledeploy/inference-gateway/epp/Makefiledeploy/inference-gateway/ext-proc/Dockerfiledeploy/inference-gateway/ext-proc/Makefiledocs/development/custom-containers.mddocs/development/unified-backends.mdlib/bindings/kvbm/src/block_manager/vllm/connector/leader/slot.rslib/kv-router/src/indexer/branch_sharded.rslib/kv-router/src/indexer/pruning.rslib/kvbm-engine/CLAUDE.mdlib/kvbm-engine/src/leader/session/initiator.rslib/kvbm-engine/src/worker/group/spmd.rslib/kvbm-physical/src/layout/config.rslib/llm/src/block_manager/pool/managed/inactive.rslib/llm/src/preprocessor.rslib/llm/src/protocols/openai/chat_completions/aggregator.rslib/llm/src/protocols/openai/completions/aggregator.rslib/mocker/src/replay/offline/single.rslib/mocker/src/scheduler/sglang/core.rslib/mocker/src/scheduler/sglang/decode.rslib/runtime/examples/rust-toolchain.tomllib/runtime/examples/system_metrics/tests/integration_test.rslib/runtime/src/pipeline/network/egress/tcp_client.rslib/runtime/src/transports/nats.rsrust-toolchain.tomltests/parity/README.md
💤 Files with no reviewable changes (1)
- lib/runtime/examples/system_metrics/tests/integration_test.rs
Thanks AI reviewers. We had to re-organize the code otherwise `cargo clippy` wants this to become `while let ..` which doesn't fit with the `break` statements. Signed-off-by: Graham King <grahamk@nvidia.com>
The usual container and doc updates, plus new lints:
ziptakes things that implementIntoIterso the.into_iter()calls were unnecessary.sort_by_keyis typically more efficient thansort_by.checked_divremoves the need to check divisor is not 0.while let ..instead ofloop { let ..Summary by CodeRabbit
Chores
Documentation
Style