-
Notifications
You must be signed in to change notification settings - Fork 238
8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix) #4294
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
Open
shruacha1234
wants to merge
3
commits into
openjdk:master
Choose a base branch
from
shruacha1234:backport_8f121a17
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. | ||
| * Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved. | ||
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| * | ||
| * This code is free software; you can redistribute it and/or modify it | ||
|
|
@@ -32,6 +32,7 @@ | |
| import jdk.internal.access.SharedSecrets; | ||
|
|
||
| class FileDispatcherImpl extends FileDispatcher { | ||
| private static final boolean SUPPORTS_PENDING_SIGNALS = NativeThread.supportPendingSignals(); | ||
|
|
||
| static { | ||
| IOUtil.load(); | ||
|
|
@@ -104,8 +105,32 @@ void close(FileDescriptor fd) throws IOException { | |
| fdAccess.close(fd); | ||
| } | ||
|
|
||
| void preClose(FileDescriptor fd) throws IOException { | ||
| /** | ||
| * Prepare the given file descriptor for closing. On Unix systems, | ||
| * if a platform thread is blocked on the file descriptor then the file descriptor is | ||
| * dup'ed to a special fd and the thread signalled so that the syscall fails with EINTR. | ||
| */ | ||
| static final void preClose(FileDescriptor fd, long reader, long writer) throws IOException { | ||
| if (reader != 0 || writer != 0) { | ||
| implPreClose(fd, reader, writer); | ||
| } | ||
| } | ||
|
|
||
| private static void signalThreads(long reader, long writer) { | ||
| if (reader != 0) | ||
| NativeThread.signal(reader); | ||
| if (writer != 0) | ||
| NativeThread.signal(writer); | ||
| } | ||
|
|
||
| static void implPreClose(FileDescriptor fd, long reader, long writer) throws IOException { | ||
|
||
| if (SUPPORTS_PENDING_SIGNALS) { | ||
| signalThreads(reader, writer); | ||
| } | ||
| preClose0(fd); | ||
| if (!SUPPORTS_PENDING_SIGNALS) { | ||
| signalThreads(reader, writer); | ||
| } | ||
shruacha1234 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| void dup(FileDescriptor fd1, FileDescriptor fd2) throws IOException { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
static void doPreClose(...)Also, please add a comment similar to the the one that was added in
preClose0(and remove the one forpreClose0as it's now outdated:preClose0is only used in this class now, so should be private.