-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8297276: Remove thread text from Subject.current #11292
Conversation
👋 Welcome back weijun! A progress list of the required criteria for merging this PR into |
@@ -325,10 +325,6 @@ public Subject run() { | |||
* retrieved by this method. After {@code action} is finished, the current | |||
* subject is reset to its previous value. The current | |||
* subject is {@code null} before the first call of {@code callAs()}. | |||
* <p> | |||
* When a new thread is created, its current subject is the same as |
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.
what about change from"when" to "if", in case some implementation still create a new thread?
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.
This is not about the implementation of this method, which might or might not allow the current subject to be inherited in a new thread. The spec change is telling the users of this method that such inheritance is no longer guaranteed. We are still not sure if the future implementation of this method can guarantee that, but given it's already broken now, we'd better remove this requirement. We can add if later if we can do that.
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.
Hm, it may still apply if the current subject to be inherited in a new thread. I fine to remove this section. A release note and known issue may be filed to notify the behavior change and issue.
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.
LGTM, dropping the inaccurate text. A release note is a good idea.
Just re-reading the javadoc for Subject.callAs. It doesn't say anything about inheritance so there shouldn't be any expectation that Subject is inherited, so I think the change proposed here is okay. For another PR but I think the callAs javadoc could say a bit more about the Subject being set for the bounded execution of the given task. When the task completes, the current Subject is null or reverts to its previous value in the current thread. |
@AlanBateman You are right. The |
@wangweij 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 72 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 d450314.
Your commit was automatically rebased without conflicts. |
With the introduction of Virtual Threads, the current subject is no longer guaranteed to be inherited in a new thread. Remove this requirement until we find another way to implement
Subject::current
.Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11292/head:pull/11292
$ git checkout pull/11292
Update a local copy of the PR:
$ git checkout pull/11292
$ git pull https://git.openjdk.org/jdk pull/11292/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11292
View PR using the GUI difftool:
$ git pr show -t 11292
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11292.diff