Skip to content

8274349: ForkJoinPool.commonPool() does not work with 1 CPU #5784

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

Closed
wants to merge 3 commits into from

Conversation

dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Oct 1, 2021

A regression introduced in Java 17 will give the default FJ pool a parallelism of zero in a uniprocessor environment. The fix restores this to a value of 1. See bug report for details.

Testing:

  • new regression test
  • tiers 1-3

Thanks,
David


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8274349: ForkJoinPool.commonPool() does not work with 1 CPU

Reviewers

Contributors

  • Doug Lea <dl@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5784/head:pull/5784
$ git checkout pull/5784

Update a local copy of the PR:
$ git checkout pull/5784
$ git pull https://git.openjdk.java.net/jdk pull/5784/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5784

View PR using the GUI difftool:
$ git pr show -t 5784

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5784.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 1, 2021

👋 Welcome back dholmes! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@dholmes-ora
Copy link
Member Author

/contributor dl@cs.oswego.edu

@openjdk
Copy link

openjdk bot commented Oct 1, 2021

@dholmes-ora Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

@dholmes-ora
Copy link
Member Author

/contributor add @DougLea

@openjdk
Copy link

openjdk bot commented Oct 1, 2021

@dholmes-ora The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Oct 1, 2021
@openjdk
Copy link

openjdk bot commented Oct 1, 2021

@dholmes-ora
Contributor Doug Lea <dl@openjdk.org> successfully added.

@dholmes-ora dholmes-ora marked this pull request as ready for review October 1, 2021 00:33
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 1, 2021
@mlbridge
Copy link

mlbridge bot commented Oct 1, 2021

Webrevs

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Oh wow. Looks good!

@openjdk
Copy link

openjdk bot commented Oct 1, 2021

@dholmes-ora This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8274349: ForkJoinPool.commonPool() does not work with 1 CPU

Co-authored-by: Doug Lea <dl@openjdk.org>
Reviewed-by: shade, martin

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 26 new commits pushed to the master branch:

  • 7e757f6: 8274559: JFR: Typo in 'jfr help configure' text
  • 75d6688: 8274745: ProblemList TestSnippetTag.java
  • 9914e5c: 8274610: Add linux-aarch64 to bootcycle build profiles
  • 0ca094b: 8273244: Improve diagnostic output related to ErroneousTree
  • 6f727d8: 8274666: rename HtmlStyle.descfrmTypeLabel to be less cryptic
  • 139a833: 8268869: java in source-file mode suggests javac-only Xlint flags
  • f63c4a8: 8274471: Verification of OCSP Response signed with RSASSA-PSS fails
  • f2404d6: 8274658: ISO 4217 Amendment 170 Update
  • 7eb0372: 8274606: Fix jaxp/javax/xml/jaxp/unittest/transform/SurrogateTest.java test
  • 47bfc8a: 8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening
  • ... and 16 more: https://git.openjdk.java.net/jdk/compare/a8edd1b360d4e5f35aff371a91fda42eeb00d395...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 1, 2021
@Martin-Buchholz
Copy link
Member

I always try to avoid Thread.sleep or polling in tests, so I would write the test like this:

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ForkJoinPool;

public class ForkJoinUniProcessor {
public static void main(String[] args) throws InterruptedException {
// If the default parallelism were zero then this task would not
// complete and the test will timeout.
CountDownLatch ran = new CountDownLatch(1);
ForkJoinPool.commonPool().submit(() -> ran.countDown());
ran.await();
}
}

@dholmes-ora
Copy link
Member Author

Thanks for the reviews @shipilev and @Martin-Buchholz !

Test updated per Martin's suggestion.

/integrate

@openjdk
Copy link

openjdk bot commented Oct 4, 2021

Going to push as commit 2e542e3.
Since your change was applied there have been 26 commits pushed to the master branch:

  • 7e757f6: 8274559: JFR: Typo in 'jfr help configure' text
  • 75d6688: 8274745: ProblemList TestSnippetTag.java
  • 9914e5c: 8274610: Add linux-aarch64 to bootcycle build profiles
  • 0ca094b: 8273244: Improve diagnostic output related to ErroneousTree
  • 6f727d8: 8274666: rename HtmlStyle.descfrmTypeLabel to be less cryptic
  • 139a833: 8268869: java in source-file mode suggests javac-only Xlint flags
  • f63c4a8: 8274471: Verification of OCSP Response signed with RSASSA-PSS fails
  • f2404d6: 8274658: ISO 4217 Amendment 170 Update
  • 7eb0372: 8274606: Fix jaxp/javax/xml/jaxp/unittest/transform/SurrogateTest.java test
  • 47bfc8a: 8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening
  • ... and 16 more: https://git.openjdk.java.net/jdk/compare/a8edd1b360d4e5f35aff371a91fda42eeb00d395...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 4, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 4, 2021
@openjdk
Copy link

openjdk bot commented Oct 4, 2021

@dholmes-ora Pushed as commit 2e542e3.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants