ci: cap cargo build parallelism to fit the 5Gi cachekit runner#51
Merged
Conversation
cargo's available_parallelism() reads the node's 32 threads, not the pod's cgroup CPU quota, so a cold (cache-miss) build fans out ~22-way and can OOM-kill the linker in the 5Gi cachekit runner — the same failure diagnosed and fixed in cachekit-rs (#25/#26). cachekit-core has been spared so far only by Swatinem/rust-cache keeping builds warm and a smaller dep graph. Add CARGO_BUILD_JOBS=4 to ci.yml, security.yml, and codeql.yml (the workflows that build cargo on the self-hosted 5Gi pool) plus fail-fast timeout-minutes backstops. release.yml is unaffected — its publish job runs on ubuntu-latest.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThree GitHub Actions workflow files ( ChangesCI OOM mitigation and timeout guardrails
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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
Cap cargo build parallelism on the self-hosted CI workflows by setting
CARGO_BUILD_JOBS: "4", plus add fail-fasttimeout-minutesbackstops.ci.yml— top-level env cap;timeout-minutes: 20ontestandsecuritysecurity.yml— append cap to the existing env block (covers the cargo-fuzz ASAN builds)codeql.yml— env cap;timeout-minutes: 30onanalyze(coldcargo build --release)release.yml— unchanged, its publish job already runs onubuntu-latestWhy
cargo'savailable_parallelism()reads the node's 32 threads (the 5950X), not the pod's cgroup CPU quota, so a cold build fans out ~22-wayrustc/ldinside the 5Gicachekitrunner cgroup. At that fan-out, peak link-time RSS can exceed 5Gi → the kernel OOM-kills the linker → the runner "loses communication with the server" and the job dies at the ~10-min heartbeat with no logs.This is the same root cause diagnosed and fixed in cachekit-rs #25/#26. cachekit-core has been spared so far only because:
Swatinem/rust-cachekeeps the dep graph warm, so the full cold compile only happens on a cache miss (Cargo.lock bump, toolchain rotation, cache eviction).Capping
-jremoves the latent OOM regardless of cache state and is effectively free on a warm cache (4 jobs is plenty when most crates are already built).Summary by CodeRabbit
Chores