Repository navigation
feat(runner): settle each attempt as it finishes and refill its unit - #497
Merged
Merged
Conversation
tick now waits on one channel that every attempt answers on. Each outcome is recorded as it arrives, its grant goes back to the pool, and the next due ticket starts in that unit, so a slow job no longer holds the whole round. Flight drops its per-attempt channel, so runner goes to 0.5.0.0. Closes #443
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.
Summary
R.ticknow records each attempt's outcome when that attempt finishes, gives its pool unit back, and starts the next due ticket in that unit. Before, one slow job held the whole round: the other units sat idle until it ended.Design decisions
(ticket id, outcome)on a shared channel, asIO.withindoes in Base. The loop receives whichever answers first. Before, the loop joined per-attempt channels in list order.Complete/Requeuebefore it changes the state and releases the grant. The nextSelectcomes after that.1 + pendingat tick start) is shared by every refill, and an idle pick gives its unit back. Each attempt settles once, so the loop's settle fuel never runs out before the last attempt ends.Flightloses itschanfield, so runner goes to0.5.0.0. Nothing imports runner from the hub yet.Validation
check.bendscenario: capacity 2, one 1 s job, and five fast jobs. Onetickruns all six. At most 2 attempts overlap in the job log, and the slow job's end is the last line. Against the oldtick, this check fails: one round ran only 2 of the 6 jobs.pick_boundedandpick_releasestill cover each claim's pool step. The log check covers the loop end to end.scripts/check.sh runnerpasses, including the crash, compaction, and webhook scenarios.scripts/publish.sh --checkpasses.Closes #443