Skip to content
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

8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix) #21087

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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