Skip to content

Commit

Permalink
8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix)
Browse files Browse the repository at this point in the history
Co-authored-by: Shruthi.Shruthi1 <[email protected]>

Signed-off-by: Varada M <[email protected]>
  • Loading branch information
varada1110 committed Sep 19, 2024
1 parent 315abdf commit 20f3462
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 22 deletions.
20 changes: 15 additions & 5 deletions src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1903,11 +1903,21 @@ private void implCloseBlockingMode() throws IOException {
}
if (NativeThread.isNativeThread(reader)
|| NativeThread.isNativeThread(writer)) {
nd.preClose(fd);
if (NativeThread.isNativeThread(reader))
NativeThread.signal(reader);
if (NativeThread.isNativeThread(writer))
NativeThread.signal(writer);
boolean isAix = System.getProperty("os.name").startsWith("AIX");
if (isAix) {
if (NativeThread.isNativeThread(reader))
NativeThread.signal(reader);
if (NativeThread.isNativeThread(writer))
NativeThread.signal(writer);
nd.preClose(fd);
}
else {
nd.preClose(fd);
if (NativeThread.isNativeThread(reader))
NativeThread.signal(reader);
if (NativeThread.isNativeThread(writer))
NativeThread.signal(writer);
}
}
}
}
Expand Down
20 changes: 15 additions & 5 deletions src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -908,11 +908,21 @@ protected void close() throws IOException {
}
if (NativeThread.isNativeThread(reader)
|| NativeThread.isNativeThread(writer)) {
nd.preClose(fd);
if (NativeThread.isNativeThread(reader))
NativeThread.signal(reader);
if (NativeThread.isNativeThread(writer))
NativeThread.signal(writer);
boolean isAix = System.getProperty("os.name").startsWith("AIX");
if (isAix) {
if (NativeThread.isNativeThread(reader))
NativeThread.signal(reader);
if (NativeThread.isNativeThread(writer))
NativeThread.signal(writer);
nd.preClose(fd);
}
else {
nd.preClose(fd);
if (NativeThread.isNativeThread(reader))
NativeThread.signal(reader);
if (NativeThread.isNativeThread(writer))
NativeThread.signal(writer);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,15 @@ private void implCloseBlockingMode() throws IOException {
if (NativeThread.isVirtualThread(th)) {
Poller.stopPoll(fdVal);
} else {
nd.preClose(fd);
NativeThread.signal(th);
boolean isAix = System.getProperty("os.name").startsWith("AIX");
if (isAix) {
NativeThread.signal(th);
nd.preClose(fd);
}
else {
nd.preClose(fd);
NativeThread.signal(th);
}
}
}
}
Expand Down
20 changes: 15 additions & 5 deletions src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1147,11 +1147,21 @@ private void implCloseBlockingMode() throws IOException {
}
if (NativeThread.isNativeThread(reader)
|| NativeThread.isNativeThread(writer)) {
nd.preClose(fd);
if (NativeThread.isNativeThread(reader))
NativeThread.signal(reader);
if (NativeThread.isNativeThread(writer))
NativeThread.signal(writer);
boolean isAix = System.getProperty("os.name").startsWith("AIX");
if (isAix) {
if (NativeThread.isNativeThread(reader))
NativeThread.signal(reader);
if (NativeThread.isNativeThread(writer))
NativeThread.signal(writer);
nd.preClose(fd);
}
else {
nd.preClose(fd);
if (NativeThread.isNativeThread(reader))
NativeThread.signal(reader);
if (NativeThread.isNativeThread(writer))
NativeThread.signal(writer);
}
}
}
}
Expand Down
11 changes: 9 additions & 2 deletions src/java.base/unix/classes/sun/nio/ch/SinkChannelImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,15 @@ private void implCloseBlockingMode() throws IOException {
if (NativeThread.isVirtualThread(th)) {
Poller.stopPoll(fdVal);
} else {
nd.preClose(fd);
NativeThread.signal(th);
boolean isAix = System.getProperty("os.name").startsWith("AIX");
if (isAix) {
NativeThread.signal(th);
nd.preClose(fd);
}
else {
nd.preClose(fd);
NativeThread.signal(th);
}
}
}
}
Expand Down
11 changes: 9 additions & 2 deletions src/java.base/unix/classes/sun/nio/ch/SourceChannelImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,15 @@ private void implCloseBlockingMode() throws IOException {
if (NativeThread.isVirtualThread(th)) {
Poller.stopPoll(fdVal);
} else {
nd.preClose(fd);
NativeThread.signal(th);
boolean isAix = System.getProperty("os.name").startsWith("AIX");
if (isAix) {
NativeThread.signal(th);
nd.preClose(fd);
}
else {
nd.preClose(fd);
NativeThread.signal(th);
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ java/net/MulticastSocket/SetLoopbackMode.java 7122846,8308807
java/net/MulticastSocket/SetOutgoingIf.java 8308807 aix-ppc64
java/net/MulticastSocket/Test.java 7145658,8308807 macosx-all,aix-ppc64

java/net/Socket/asyncClose/Race.java 8317801 aix-ppc64

############################################################################

Expand Down

0 comments on commit 20f3462

Please sign in to comment.