Skip to content

feat(jest-worker): add gnumake jobclient to limit number of workers#12968

Closed
milahu wants to merge 1 commit intojestjs:mainfrom
milahu:add-gnumake-jobclient
Closed

feat(jest-worker): add gnumake jobclient to limit number of workers#12968
milahu wants to merge 1 commit intojestjs:mainfrom
milahu:add-gnumake-jobclient

Conversation

@milahu
Copy link
Copy Markdown
Contributor

@milahu milahu commented Jun 26, 2022

Summary

limit jobs when jest-worker is running under make / cmake / ninja

Details

use case: chromium or qtwebengine
call stack: devtools-frontend -> rollup -> terser -> jest-worker

by default, jest-worker spawns $nproc workers (100 workers on a 100 core machine)
even if jobs are limited with make -j10 -l10

this overload causes trouble on build servers -> downstream issue NixOS/nixpkgs#178171

based on my gnumake-tokenpool

needs some polish -> draft PR

Versions

Test plan

manual test in packages/jest-worker/tests/jobserver/test.sh
todo: integrate with automatic tests
the test requires gnumake to run

synthetic test is passing

i have integrated this change into chromium, now the job count is limited by ninja

API change

i had to change some internal APIs between Farm and WorkerPool (bump major version?)
i hope noone depends on the old APIs ...
if needed, this can be made backward compatible

debug prints

for production builds, the debug prints could be removed by typescript

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Hi @milahu!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@milahu milahu force-pushed the add-gnumake-jobclient branch 3 times, most recently from dc45dc8 to 7eaa4be Compare June 26, 2022 16:57
@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@milahu milahu force-pushed the add-gnumake-jobclient branch 2 times, most recently from 859f57c to 3f1400c Compare June 27, 2022 19:19
@milahu milahu force-pushed the add-gnumake-jobclient branch from 3f1400c to 51a3857 Compare July 1, 2022 19:42
@milahu milahu mentioned this pull request Jul 4, 2022
13 tasks
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 4, 2023

This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jul 4, 2023
@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 3, 2023

This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this Aug 3, 2023
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 3, 2023

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants