-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8295673: Deprecate and disable legacy parallel class loading workaround for non-parallel-capable class loaders #10832
Conversation
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
…arallel-capable class loaders
731d87e
to
3f5be0a
Compare
Webrevs
|
/label add core-libs |
@mlchung |
Adding core-libs-dev so that more developers know this behavioral change. Background: Prior to JDK 7, custom class loaders using non-hierarchical class delegation model were prone to deadlock (see [1] for details). This workaround was added in the VM in JDK 6 to allow parallel class loading for non-parallel-capable class loaders to avoid deadlocks. The VM also supports a common workaround at the time that some customers explicitly issue a wait() on the class loader lock. Such workaround was kept to allow those customers to migrate to using multi-thread-safe parallel-capable class loaders. It has been 11 years since Java 7 and it's expected that those deadlock-prone custom class loaders should have migrated to the parallel-capable class loaders. If customers have class loaders depending on this legacy behavior, they can set Refers to CSR JDK-8295848 for details. |
@coleenp 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:
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 41 new commits pushed to the
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a little clearer if the bug synopsis was "Deprecate and disable legacy ...".
A couple of queries below, but otherwise this looks good - and it will be good to see this old workaround disappear.
Thanks.
@coleenp Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks.
Thank you for the discussions, CSR, help and code reviews, @mlchung and @dholmes-ora . |
Going to push as commit 76790ad.
Your commit was automatically rebased without conflicts. |
This change adds an option EnableWaitForParallelLoad to enable the legacy behavior where the VM will manage synchronization for multiple threads loading the same class using a non-parallel capable class loader that have released the class loader lock. The VM will break the class loader lock for parallel threads trying to load the class, and wait for the first thread that initiated loading the class to complete. The subsequent threads will use the result of the first thread, rather than get a LinkageError: duplicate class definition for loading the class without synchronization.
Releasing the class loader lock was a common workaround for class loaders that used a non-hierarchical delegation scheme to avoid deadlock, before parallel capable class loading was added.
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ClassLoader.html#registerAsParallelCapable()
Tested with tier1-6 and internal applications.
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10832/head:pull/10832
$ git checkout pull/10832
Update a local copy of the PR:
$ git checkout pull/10832
$ git pull https://git.openjdk.org/jdk pull/10832/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10832
View PR using the GUI difftool:
$ git pr show -t 10832
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10832.diff