-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8249627: Degrade Thread.suspend and Thread.resume #10324
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
Conversation
👋 Welcome back alanb! A progress list of the required criteria for merging this PR into |
@AlanBateman The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
@AlanBateman Unknown command |
@AlanBateman Unknown command |
@AlanBateman Unknown command |
/label remove build |
@AlanBateman |
@AlanBateman |
@AlanBateman |
/csr |
@AlanBateman this pull request will not be integrated until the CSR request JDK-8293975 for issue JDK-8249627 has been approved. |
Code changes look fine, though I didn't look too closely at the JDWP and JVMTI stuff. Nice use of JUnit. Not a big deal, but I could see leaving the links from Might also be useful in the CSR to re-emphasize that this does not affect the ability to suspend and resume threads through the debugging interfaces. Of course the specs in those areas need to be updated so they no longer deal with the case of a thread that's been suspended through the API, but the debugging mechanisms' functions themselves are unchanged. |
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.
Changes look good.
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,
Serguei
Hello Alan, this PR deletes the Edit: Please ignore what I said - I now see that these tests have been moved to a new test file. |
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.
One minor nit but otherwise looks good!
Thanks.
@@ -494,7 +494,6 @@ private static ThreadGroup getRootGroup() { | |||
* calling thread is not allowed to modify the thread argument. | |||
* <p> | |||
* This method is invoked for the current security manager by the | |||
* {@code stop}, {@code suspend}, {@code resume}, |
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.
Why is stop being removed in this PR?
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.
Why is stop being removed in this PR?
It's just the sequencing of the two PRs and avoid merge conflicts. The Thread.stop should really edit this sentence, then this PR will edit it again. It was simpler to just do the SM edits in one PR.
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.
The java.base
changes look fine to me.
Leonid has integrated JDK-8289607 to remove the last usages of Thread.suspend/resume from the hotspot tests so I've refreshed this PR to drop the temporary excluding of these tests. |
Wakeup bot |
@AlanBateman 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 20 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 |
/integrate |
Going to push as commit 1abf971.
Your commit was automatically rebased without conflicts. |
@AlanBateman Pushed as commit 1abf971. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Degrade Thread.suspend/resume to throw UOE unconditionally.
Another step in the removal of this deadlock prone mis-feature from the user-facing API. Thread.suspend/resume have been deprecated since JDK 1.2 (1998) and terminally deprecated since Java 14. ThreadGroup.suspend/resume were degraded to throw UOE in Java 19. As of Java 19, Thread.suspend/resume continues to work for platform threads but throws UOE for virtual threads. The next step is to degrade both methods to throw UOE for all threads. A corpus search of 19M classes in 113k JAR files found only 22 classes using these methods so this change is unlikely to be disruptive.
The change requires some minor adjustments to the JVM TI and JDWP specifications, and a minor update to the JDI docs.
Leonid Mesnik is working on PR10351 to remove/replace the last few usages of Thread.suspend/resume from the hotspot tests (most of these can use JVMTI SuspendThread/ResumeThread).
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10324/head:pull/10324
$ git checkout pull/10324
Update a local copy of the PR:
$ git checkout pull/10324
$ git pull https://git.openjdk.org/jdk pull/10324/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10324
View PR using the GUI difftool:
$ git pr show -t 10324
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10324.diff