Serialize webpack and karma tasks on CI to stop runner OOM kills - #38
Merged
Merged
Conversation
Under org.gradle.parallel, the production webpack and browser-test tasks of several modules overlap alongside the Gradle and Kotlin daemons and exhaust ubuntu-latest's 16 GB. The runner is then killed mid-build, and the job ends as "The operation was canceled" or "The runner has received a shutdown signal" with no Gradle error. A shared build service with maxParallelUsages = 1 runs those tasks one at a time when CI is set; local builds stay parallel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Serializing webpack and karma was not enough: run 36447154005 was still killed, this time just after :web's production and test Kotlin/JS and Wasm compiles, which run in the Kotlin daemon rather than webpack. Give the runner a 12 GB swapfile so the peak pages out, and sample memory, disk and the largest processes into the Build step's own log so the next failure, if any, shows what was resident. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Recent PR and
mainbuilds end withThe operation was canceled(and in one caseThe runner has received a shutdown signal), with no Gradle error. Examples: runs 36441940916, 36441963416, 36441623654, 36303975869.In every one of them the
Buildstep dies during the web bundling phase. In the failingmainrun,jsBrowserProductionWebpack/wasmJsBrowserProductionWebpackforui,shared-composeandweboverlapped withshared-compose's browser tests. Each webpack task starts a Node process sized for a full Compose bundle, and karma adds a Chrome. Together with the 4 GB Gradle daemon and the Kotlin daemon, that exhausts the 16 GB runner and it gets killed. The one recent green run happened to schedule those tasks one after another.Fix
A shared build service with
maxParallelUsages = 1, used by everyKotlinWebpackandKotlinJsTesttask. The limit only applies whenCIis set, so local builds stay parallel.Checked locally with
CI=true ./gradlew build --dry-run. This PR's own CI run is the real test.Follow-up if this isn't enough
presenter,uiandshared-composeeach build a production webpack bundle duringbuildonly becausebinaries.executable()was added for their browser tests.🤖 Generated with Claude Code