scheduling: stop reparsing resource quantities for every worker in Ha… #2016
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 222 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.323
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2016"
general
weight: 0.35
Oneimu
scheduling: stop reparsing resource quantities for every worker in HasRoom
Fixes the scheduler GC storm and CPU overhead from resource parsing in
HasRoom(go/ate-100k).Problem
ScheduleasksHasRoomof every worker in the fleet. On each call,HasRoomparsed three sets of quantity strings intoQuantitiesmaps: the actor's limits, the worker's capacity, and the worker's allocation. The limits are identical for every worker in a pass, and capacity and allocation strings repeat across the fleet, yet every call built fresh maps and reparsed everything.Measured, that was 6 allocations and about 2 KB per worker per placement. A contended resume retries the full fleet scan up to 12 times. At 100k actors this is megabytes of garbage per resume and steady GC pressure on the API server. Quantities that leave the Kubernetes
int64fast path, such as1.5Gi, additionally drovebig.Intarithmetic on every worker.Change
resources.RoomCheck, built once per placement pass. It parses the actor's size once, reads each worker's capacity and allocation in wire form without building a map, and memoizes every quantity string it sees so a string read on one worker is never parsed again for another. Memoized quantities are normalized to plainint64form, so slow-path values no longer cause per-workerbig.Intarithmetic and share no mutable state between workers.Schedulebuilds one check for the pass and callshasRoomWithCheckfor each worker.HasRoomkeeps its signature and builds a one-shot check, so the admit callback under the store row lock is unchanged.HasRoomdoc comment described unreported dimensions as unconstrained. It now matches the code, which treats them as none of that resource.