ci: supersede in-progress runs on push to main#1167
Open
leolara wants to merge 1 commit into
Open
Conversation
The concurrency group fell back to github.run_id when github.head_ref was empty, which is every push to main. A unique run_id per run meant no two runs ever shared a group, so cancel-in-progress never fired on main. A burst of merges then stacked CI and Docker runs that all ran to completion, saturating the shared (especially macOS) runner pool and pushing wall-clock into the hours through queue contention. Fall back to github.ref instead, so every push to a branch shares one group and the newer run supersedes the older one. Pull requests are unchanged: head_ref is still set there and keys the group by source branch.
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.
Problem
The concurrency group in
ci.ymlanddocker.ymlfell back togithub.run_idwhengithub.head_refwas empty — which is the case for every push to main:run_idis unique per run, so no two main runs ever shared a group andcancel-in-progressnever fired on main. A burst of merges (observed: four commits within ~47s) stacked CI and Docker runs that all ran to completion, saturating the shared runner pool — especially the small macOS pool — and pushing wall-clock into the hours through queue contention. In one run, jobs sat queued ~81 min before starting, even though the actual work was ~10 min.Fix
Fall back to
github.refinstead, so every push to a branch shares one concurrency group and the newer run supersedes the older one:Pull requests are unchanged:
head_refis still set there and keys the group by source branch, so per-PR superseding works exactly as before.Trade-off
An in-progress run on main is now cancelled by the next merge. That is intended — only the latest state of main needs full CI — but it means intermediate commits between rapid merges won't get a complete green run.