Skip to content

Reset Gradle oom score before launch#3898

Draft
sjchmiela wants to merge 1 commit into
stanley/gradle-launch-execfrom
stanley/gradle-oom-score-reset
Draft

Reset Gradle oom score before launch#3898
sjchmiela wants to merge 1 commit into
stanley/gradle-launch-execfrom
stanley/gradle-oom-score-reset

Conversation

@sjchmiela

Copy link
Copy Markdown
Contributor

Summary

Replace the delayed Gradle descendant oom_score_adj scan with an immediate shell-level reset before launching Gradle.

The worker service is protected with OOMScoreAdjust=-999, so Gradle inherits that value unless we reset it. This changes the Gradle launch wrapper to write 0 to /proc/$$/oom_score_adj before exec ./gradlew ..., which makes Gradle and its child processes inherit the default OOM score instead of the worker's protected score.

This PR is stacked on #3897.

Validation

  • yarn --cwd packages/build-tools typecheck
  • yarn oxfmt --check packages/build-tools/src/android/gradle.ts packages/build-tools/src/steps/utils/android/gradle.ts
  • yarn oxlint --type-aware --import-plugin --tsconfig ./tsconfig.oxlint.json packages/build-tools/src/android/gradle.ts packages/build-tools/src/steps/utils/android/gradle.ts

@sjchmiela sjchmiela force-pushed the stanley/gradle-launch-exec branch from 7352b4f to 0d70011 Compare June 25, 2026 11:58
@sjchmiela sjchmiela force-pushed the stanley/gradle-oom-score-reset branch from 66cbf1b to 6664fc5 Compare June 25, 2026 12:00
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.06%. Comparing base (f15ecd7) to head (71bce04).

Files with missing lines Patch % Lines
packages/build-tools/src/utils/gradle.ts 20.00% 4 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           stanley/gradle-launch-exec    #3898      +/-   ##
==============================================================
+ Coverage                       59.03%   59.06%   +0.04%     
==============================================================
  Files                             937      936       -1     
  Lines                           40937    40906      -31     
  Branches                         8622     8623       +1     
==============================================================
- Hits                            24163    24159       -4     
+ Misses                          16678    16651      -27     
  Partials                           96       96              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sjchmiela sjchmiela force-pushed the stanley/gradle-launch-exec branch from 0d70011 to f15ecd7 Compare June 25, 2026 12:04
@sjchmiela sjchmiela force-pushed the stanley/gradle-oom-score-reset branch from 6664fc5 to 71bce04 Compare June 25, 2026 12:06
@github-actions

Copy link
Copy Markdown

❌ It looks like a changelog entry is missing for this PR. Add it manually to CHANGELOG.md.
⏩ If this PR doesn't require a changelog entry, such as if it's an internal change that doesn't affect the user experience, you can add the "no changelog" label to the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant