Repository navigation
fix(parallel): size the process budget by the cgroup CPU quota - #338
Merged
Merged
Conversation
runtime.NumCPU() counts host cores, not the container's quota, and go.mod's `go 1.23` keeps Go's container-aware GOMAXPROCS off. On the quadronix CI job pods (256 host cores, cpu.max 16 CPUs) the budget was 256, so the gate started ~350 prettier processes on 16 CPUs; they missed the 30 s formatter deadline and the Kuvryn nightly failed on files reported UNCHECKED. parallel.CPUs() now caps NumCPU by cgroup v2 cpu.max (or v1 cfs_quota/period), rounding a fractional quota up, at least one. The shared budget and the SAST slot count both use it.
Merged
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.
runtime.NumCPU() counts host cores, not the container's quota, and
go.mod's
go 1.23keeps Go's container-aware GOMAXPROCS off. On thequadronix CI job pods (256 host cores, cpu.max 16 CPUs) the budget was
256, so the gate started ~350 prettier processes on 16 CPUs; they missed
the 30 s formatter deadline and the Kuvryn nightly failed on files
reported UNCHECKED.
parallel.CPUs() now caps NumCPU by cgroup v2 cpu.max (or v1
cfs_quota/period), rounding a fractional quota up, at least one. The
shared budget and the SAST slot count both use it.
Tests:
go test ./...passes; newTestCPUsFromFollowsTheCgroupQuotafails without the fix.procoder check: 0 blocking.