-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8330748: ByteArrayOutputStream.writeTo(OutputStream) pins carrier #18901
Conversation
👋 Welcome back bpb! A progress list of the required criteria for merging this PR into |
@bplb 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
Tiers 1-3 passed on the usual platforms. |
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.
As a temporary workaround then I think this is okay. It does mean there needs to a heap space for the snapshot. Aside from that, the behavioral difference should only be observable to something that is relying on unspecified behavior. BAOS does not document anything about thread safety or that its methods are synchronized.
Has the alternative of moving to a j.u.c.Lock (Needs Reentrant or not?) been explored/benchmarked? |
Yes, decided not to do because it's just guarding access to a byte[] and any changes can influence the inlining. Plus, it would need to continue to use monitors when extended as the subclass may assume synchronization in the super class. Limiting it to just the problematic writeTo method seem the least risky. |
That's true, good points across the board. |
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.
Updated version looks fine.
Running tests now. Assuming those pan out, will likely integrate tomorrow. |
/integrate |
Going to push as commit 819f3d6.
Your commit was automatically rebased without conflicts. |
Prevent blocking due to a carrier thread not being released when
ByteArrayOutputStream.writeTo
is invoked from a virtual thread.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18901/head:pull/18901
$ git checkout pull/18901
Update a local copy of the PR:
$ git checkout pull/18901
$ git pull https://git.openjdk.org/jdk.git pull/18901/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18901
View PR using the GUI difftool:
$ git pr show -t 18901
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18901.diff
Webrev
Link to Webrev Comment