Skip to content

Conversation

DougLea
Copy link
Contributor

@DougLea DougLea commented Jun 3, 2023

Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" and related issues.

This is a major ForkJoin update (and hard to review -- sorry) that finally addresses incompatibilities between ExecutorService and ForkJoinPool (which claims to implement it), with the goal of avoiding continuing bug reports and incompatibilities. Doing this required reworking internal control to use phaser/seqlock-style versioning schemes (affecting nearly every method) that ensure consistent data structures and actions without requiring global synchronization or locking on every task execution that would massively degrade performance. The previous lack of a solution to this was the main reason for these incompatibilities.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Change requires CSR request JDK-8309407 to be approved
  • Commit message must refer to an issue

Issues

  • JDK-8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" (Bug - P3)
  • JDK-8309407: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14301/head:pull/14301
$ git checkout pull/14301

Update a local copy of the PR:
$ git checkout pull/14301
$ git pull https://git.openjdk.org/jdk.git pull/14301/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14301

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14301.diff

Webrev

Link to Webrev Comment

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

This is a large update to fix a really hard problem. I've been testing and running with these changes on and off for several months and they are stable now. The code is very dense and hard to read but the description at a top is very good/helpful.

The API changes are okay. The source compatibility issue with dropping the override of the invokeAll combinator is unfortunate but combined with everything else it means that FJP now implements the ES contract and can work as a replacement for say TPE.

So I think this changes are good to go.

ns = nanos - (System.nanoTime() - startTime);
}
}
for (int i = futures.size() - 1; i >= 0; --i)
Copy link
Contributor

Choose a reason for hiding this comment

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

@DougLea Might not be necessary for performance, but using an ArrayDeque and using pollLast() might be cleaner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a good enough idea that I started doing it until realizing/remembering that ArrayDeque doesn't implement List so can't be used here (without making a copy). Oh well.

Copy link
Contributor

Choose a reason for hiding this comment

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

@DougLea Ouch—I completely missed that it is also returned. Apologies :(

@viktorklang-ora
Copy link
Contributor

I gave the PR a final review just now, there was a few questions which might not warrant any changes.

I concur with the assessment that these changes should be good to go.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Oct 13, 2023
@openjdk
Copy link

openjdk bot commented Oct 13, 2023

@DougLea 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:

8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted"

Reviewed-by: alanb

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 ready Pull request is ready to be integrated csr Pull request needs approved CSR before integration and removed ready Pull request is ready to be integrated labels Oct 13, 2023
@openjdk
Copy link

openjdk bot commented Oct 20, 2023

@DougLea this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8288899
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Oct 20, 2023
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Oct 20, 2023
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Oct 24, 2023
@DougLea
Copy link
Contributor Author

DougLea commented Oct 27, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Oct 27, 2023

Going to push as commit 667cca9.
Since your change was applied there have been 6 commits pushed to the master branch:

  • b9dcd4b: 8318964: Fix build failures caused by 8315097
  • d52a995: 8315097: Rename createJavaProcessBuilder
  • 957703b: 8307168: Inconsistent validation and handling of --system flag arguments
  • 5b5fd36: 8316632: Shenandoah: Raise OOME when gc threshold is exceeded
  • abad040: 8313781: Add regression tests for large page logging and user-facing error messages
  • 9123961: 8318096: Introduce AsymmetricKey interface with a getParams method

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 27, 2023
@openjdk openjdk bot closed this Oct 27, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 27, 2023
@openjdk
Copy link

openjdk bot commented Oct 27, 2023

@DougLea Pushed as commit 667cca9.

💡 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 [email protected] integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

5 participants