8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix)#4294
8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix)#4294shruacha1234 wants to merge 6 commits intoopenjdk:masterfrom
Conversation
Signed-off-by: Shruthi <Shruthi.Shruthi1@ibm.com>
|
👋 Welcome back sacharya! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This backport pull request has now been updated with issue from the original commit. |
Webrevs
|
|
This backport is being done very differently in JDK 17u because for JDK 21u the following dependencies where included first in the JDK 21 release before doing the actual backport for this bug:
It would have helped if this information was provided to the reader. If we end up going this route without the enhancement backports (which should be fine IMO), then we should more accurately model it to pre-existing JDK 17u code. A review follows shortly. |
|
/reviewers 2 Reviewer |
Signed-off-by: Shruthi <Shruthi.Shruthi1@ibm.com>
Signed-off-by: Shruthi <Shruthi.Shruthi1@ibm.com>
jerboaa
left a comment
There was a problem hiding this comment.
The build failure should be resolved in a different way (rename the shared static method).
Signed-off-by: Shruthi <Shruthi.Shruthi1@ibm.com>
Signed-off-by: Shruthi <Shruthi.Shruthi1@ibm.com>
jerboaa
left a comment
There was a problem hiding this comment.
This looks OK to me. Nit: Please make static native void preClose0 in FileDispatcherImpl.java private as it's only used in that class now.
Signed-off-by: Shruthi <Shruthi.Shruthi1@ibm.com>
|
@tstuefe Could you please help with a second review for this unclean backport? Thanks! |
|
I am not an expert in that area, and this touches shared coding, so I am a bit apprehensive about this one. Tests should definitely be done on all platforms, not only AIX. Please ask SAP, specifically @JoKern65 , for a review. |
|
@JoKern65 Can you please review this PR |
JoKern65
left a comment
There was a problem hiding this comment.
I cannot test it on AIX at SAP, because we do not support AIX on jdk17. But the changes look good and should not introduce a different behavior on other platforms than before. And for AIX the change results in the same already established logic of the higher releases.
So for me it looks good.
|
/approval JDK-8317801 request backport fix, resolves a race condition in socket close handling that led to intermittent failures in java/net/Socket/asyncClose/Race.java on AIX in 17u-dev. The upstream fix from 21u could not be applied directly due to differences in the NIO dispatcher design (absence of UnixDispatcher, related refactorings, and virtual thread support), so it was adapted by updating NativeDispatcher.preClose to take reader/writer thread IDs, moving signalling into FileDispatcherImpl, and modifying channel implementations to delegate signalling through the dispatcher. This preserves the original fix’s intent of correctly signalling threads blocked in I/O during pre-close. Tested with AIX build, java_io, java_nio, jdk_net, and 500 iterations of Race.java with no failures. |
|
@shruacha1234 |
|
This will still need a second review from an updates reviewer. |
tstuefe
left a comment
There was a problem hiding this comment.
Okay, patch looks functionally equivalent to upstream patch. Thanks @JoKern65 for looking at this.
However, please run the full test suite (at least jdk tier1 and tier2) on all platforms, not only AIX, before pushing, and make sure this does not cause regressions.
@jerboaa I think we should make @JoKern65 updates reviewer. Does he have to be reviewer in mainline for that to happen?
|
I ran jdk:tier1 and jdk:tier2 tests on AIX, Linux, and macOS, and observed no regressions. The reported failures are the same both with and without my fix. |
This pull request contains a backport of commit 8f121a17 from the openjdk/jdk repository.
OpenJDK bug : https://bugs.openjdk.org/browse/JDK-8317801
This fix resolves a race condition in socket close handling that led to intermittent failures in Race.java on AIX in JDK17u-dev
The original patch didn’t apply cleanly to the JDK17u-dev branch due to differences in the NIO dispatcher implementation:
UnixDispatcherintroduced in later JDK versions does not exist in JDK17.Virtual threadrelated logic in the original patch is not present in JDK17.To adapt the change for JDK17:
NativeDispatcher.preClosewas updated to accept the reader and writer thread IDs.FileDispatcherImpl.These changes preserve the functional intent of the upstream patch, ensuring that threads blocked in I/O operations are correctly signalled when a file descriptor is pre-closed.
Testing : local AIX build, java_io, java_nio, jdk_net
Additionally, executed java/net/Socket/asyncClose/Race.java 500 times to check for intermittent failures. No failures were observed.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/4294/head:pull/4294$ git checkout pull/4294Update a local copy of the PR:
$ git checkout pull/4294$ git pull https://git.openjdk.org/jdk17u-dev.git pull/4294/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4294View PR using the GUI difftool:
$ git pr show -t 4294Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/4294.diff
Using Webrev
Link to Webrev Comment