-
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
8301341: LinkedTransferQueue does not respect timeout for poll() #14317
Conversation
👋 Welcome back dl! A progress list of the required criteria for merging this PR into |
Webrevs
|
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 looks okay to me, it was a bit easier than I expected.
The only comment I have is an interrupt while spinning won't be noticed until count goes to 0, that should be rare enough that it doesn't matter. We might have to tune SPIN_FOR_TIMEOUT_THRESHOLD at some point for virtual threads.
@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:
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 |
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Outdated
Show resolved
Hide resolved
@DougLea @AlanBateman I had a look as well, didn't find anything to comment on. 👍 |
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Outdated
Show resolved
Hide resolved
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.
Need to digest this a bit. Will give more concrete feedback ASAP :)
src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java
Outdated
Show resolved
Hide resolved
/issue JDK-8300663 |
/issue JDK-8267502 |
@DougLea |
@DougLea |
A backport note: This set of changes may be applied jdk19+ by removing only the lines (currently L423-424) in LinkedTransferQueue: |
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Show resolved
Hide resolved
src/java.base/share/classes/java/util/concurrent/LinkedTransferQueue.java
Show resolved
Hide resolved
/integrate |
Going to push as commit 8d1ab57.
Your commit was automatically rebased without conflicts. |
Thanks for making the fixes Doug! It seems to be a very common issue for openHAB users now that they upgrade to openHAB 4 which requires Java 17. See: |
@wborn I think 17 should also be OK modulo deleting 2 lines for pre-21 mentioned above. I only checked with 19 though.. |
/backport jdk21u |
@robm-openjdk the backport was successfully created on the branch robm-openjdk-backport-8d1ab570 in my personal fork of openjdk/jdk21u. To create a pull request with this backport targeting openjdk/jdk21u:master, just click the following link: The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u:
|
@DougLea is there any timeline where we can expect the backport of this fix into jdk17? or any other work around? |
@suryag10 Sorry I'm not the right person to ask about backports. |
Like Doug notes, the JDK backports are managed as a separate project. Details are available here https://openjdk.org/projects/jdk-updates/. For JDK 17 the corresponding project is https://wiki.openjdk.org/display/JDKUpdates/JDK+17u which has the necessary details about the process as well as the mailing list details where you can bring up the backporting question. |
Just my 2 cents—given the size of this change, I'd be hesitant to have it backported. Also, more than this PR would need to be backported, for instance: #19271 |
This update addresses performance issues across both LinkedTransferQueue and SynchronousQueue by creating a common basis for implementation across them (mainly in LinkedTransferQueue). Pasting from internal doc summary of changes:
* * Class DualNode replaces Qnode, with fields and methods
* that apply to any match-based dual data structure, and now
* usable in other j.u.c classes. in particular, SynchronousQueue.
* * Blocking control (in class DualNode) accommodates
* VirtualThreads and (perhaps virtualized) uniprocessors.
* * All fields of this class (LinkedTransferQueue) are
* default-initializable (to null), allowing further extension
* (in particular, SynchronousQueue.Transferer)
* * Head and tail fields are lazily initialized rather than set
* to a dummy node, while also reducing retries under heavy
* contention and misorderings, and relaxing some accesses,
* requiring accommodation in many places (as well as
* adjustments in WhiteBox tests).
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14317/head:pull/14317
$ git checkout pull/14317
Update a local copy of the PR:
$ git checkout pull/14317
$ git pull https://git.openjdk.org/jdk.git pull/14317/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14317
View PR using the GUI difftool:
$ git pr show -t 14317
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14317.diff
Webrev
Link to Webrev Comment