Repository navigation
Hold a worker for a queued action whose reservation only fits an idle one - #2933
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
amankrx
force-pushed
the
feat/reservation-hold
branch
from
October 13, 2026 18:18
4289efe to
d7005bb
Compare
corcillo
reviewed
Oct 13, 2026
corcillo
reviewed
Oct 13, 2026
corcillo
reviewed
Oct 13, 2026
corcillo
reviewed
Oct 13, 2026
corcillo
reviewed
Oct 13, 2026
corcillo
reviewed
Oct 13, 2026
corcillo
requested changes
Oct 13, 2026
# Conflicts: # nativelink-util/src/metrics.rs # web/apps/docs/content/docs/reference/metrics.mdx
corcillo
approved these changes
Oct 13, 2026
This branch was successfully 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.
What and why
An action whose reservation only fits an idle worker starves under load. Every matching pass tries it first, finds each worker partly busy, then fills the room that opens with newer, smaller actions, so no worker ever drains for it while the fleet reads as free. One deployment had 10,610 of 23,866 targets in a 16 GiB class on 20 GiB workers; one replica logged 27,202 live-memory vetoes for them in 30 minutes while the queue grew.
reservation_hold(off by default) holds a worker for such an action once it has waitedhold_after_sand fits no busy worker until more than one of that worker's actions finish; an action one completion would make room for is only waiting its turn, which the pass order already gives it. The worker chosen fits the action idle, has not declined that much while idle, and has the fewest actions running and then the most memory free as last reported. It is offered nothing else, and the action is placed there as soon as the ledger and the live veto allow. The hold stays through the dispatch until the worker takes the action; a decline sends the action back with the hold kept, unless the worker declined it idle, in which case the next pass holds another. The hold ends when a worker takes the action anywhere, when it leaves the queue, when the worker leaves or drains, or aftermax_hold_s; an expired hold is not repeated until as long again has passed, twice as long for each expiry in a row on an idle worker. At mostmax_held_workersare held per replica, and replicas sharing a queue take turns per action by a hash over the replicas whose workers would fit it, so one worker is held fleet-wide. Both durations must be above zero. Counterscheduler.worker.holds{scheduler.hold.outcome}, gaugescheduler.worker.held.How was this verified?
reservation_hold_test.rs: held then placed when the worker drains, no hold for an action one completion makes room for, expiry and cooldown, cooldown doubling on an idle expiry under the live veto, a declined dispatch keeping the hold, an idle-declined worker passed over and a hold moving after an idle decline, the memory tiebreak, release on drain, leave and when the action leaves the queue, placement elsewhere, the cap, and replicas taking turns. Scheduler, service, util and config suites and clippy pass.Risk
Off unless configured; a held worker runs below capacity for at most
max_hold_s, and the cap bounds how many per replica.AI assistance
An agent drafted the change and I reviewed every line.