Skip to content

[worker] warn on invalid resource class config when setting GRADLE_OPTS#3660

Open
sswrk wants to merge 1 commit intomainfrom
szymonswierk/warn-on-worker-max-heap-size-fallback
Open

[worker] warn on invalid resource class config when setting GRADLE_OPTS#3660
sswrk wants to merge 1 commit intomainfrom
szymonswierk/warn-on-worker-max-heap-size-fallback

Conversation

@sswrk
Copy link
Copy Markdown
Contributor

@sswrk sswrk commented Apr 30, 2026

Why

This issue expo/expo#45213 is reporting that the max heap size in Gradle options is set to an incorrect value when the resource class is large (should be -Xmx8g, is -Xmx4g).

I suspect the worker is receiving an empty or incorrect resourceClass config value, as we silently fallback to 4g in such cases. This PR adds Sentry reporting to enable us to easily track such cases. Reporting is turned off in Environment.TEST.

How

Report a sentry warning on:

  • No config.resourceClass set
  • Unknown config.resourceClass

The reporting is plugged just before determining the Gradle options getBuildEnv in packages/worker/src/env.ts.

Test Plan

CI passes.

@sswrk sswrk added the no changelog PR that doesn't require a changelog entry label Apr 30, 2026
@github-actions
Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.96%. Comparing base (8229dc8) to head (3c6fa5f).

Files with missing lines Patch % Lines
packages/worker/src/env.ts 12.50% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3660      +/-   ##
==========================================
- Coverage   55.97%   55.96%   -0.00%     
==========================================
  Files         866      866              
  Lines       37312    37320       +8     
  Branches     7759     7761       +2     
==========================================
+ Hits        20882    20883       +1     
- Misses      16334    16339       +5     
- Partials       96       98       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@sswrk sswrk marked this pull request as ready for review April 30, 2026 11:58
@sswrk sswrk requested a review from sjchmiela April 30, 2026 11:58
@github-actions
Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder

Generated by CodeMention

@sswrk sswrk changed the title [worker] warn on invalid resource class config [worker] warn on invalid resource class config when setting GRADLE_OPTS Apr 30, 2026
Copy link
Copy Markdown
Contributor

@sjchmiela sjchmiela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sssso resource classes is an outdated concept, or a concept we're trying to move away from. For instance, workflow-orchestration has never and will never provide the resourceClass in config.

Maybe we want to instead of relying on resource class, execute some command to learn the free memory on the instance and adjust GRADLE_OPTS from there?

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

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants