-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--jobs not respected in Bazel 7 #20521
Comments
It's due to the upgrade to JDK21 where the implementation of ForkJoinPool has changed -- the number of core threads is larger than |
@bazel-io fork 7.1.0 |
Thanks for looking into it. Yes, using |
Bazel 7 upgrades its runtime JVM to 21. However, the implementation of `ForkJoinPool` in JDK 21 is changed so that the number of concurrent actions may be larger than `--jobs`. Flag `--experimental_use_semaphore_for_jobs` was introduced to fix this problem. This CL flips it to make `--jobs` work again by default. Fixes bazelbuild#20521. PiperOrigin-RevId: 590834204 Change-Id: I0ddf1e1a088eb4d917036350533df94c17ac48e6
Bazel 7 upgrades its runtime JVM to 21. However, the implementation of `ForkJoinPool` in JDK 21 is changed so that the number of concurrent actions may be larger than `--jobs`. Flag `--experimental_use_semaphore_for_jobs` was introduced to fix this problem. This CL flips it to make `--jobs` work again by default. Fixes #20521. Commit 3c298fd PiperOrigin-RevId: 590834204 Change-Id: I0ddf1e1a088eb4d917036350533df94c17ac48e6 Co-authored-by: Googler <[email protected]> Co-authored-by: Yun Peng <[email protected]>
A fix for this issue has been included in Bazel 7.1.0 RC1. Please test out the release candidate and report any issues as soon as possible. Thanks! |
Description of the bug:
We have used
--jobs
to control the number of jobs that should be executed concurrently. This works as expected in Bazel 6 however, in Bazel 7, this functionality does not work as expected.Which category does this issue belong to?
Core
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
JobsRepro.zip
even though jobs=1 is specified in the .bazelrc, we still see parallel jobs > 1.
3. But the same example, with Bazel 6.4, respects --jobs=1.
--local_cpu_resources=1
, then it seems to work as expected. But from the documentation, --jobs is a global override to control such parallelism, wondering if this is a regression or if this behavior is driven differently in Bazel 7 intentionally.Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?7.0.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: