-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8285515: (dc) DatagramChannel.disconnect fails with "Invalid argument" on macOS 12.4 beta2 #8445
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
Conversation
👋 Welcome back jpai! A progress list of the required criteria for merging this PR into |
Webrevs
|
@@ -50,20 +50,28 @@ Java_sun_nio_ch_DatagramChannelImpl_disconnect0(JNIEnv *env, jclass clazz, | |||
jint fd = fdval(env, fdo); | |||
int rv; | |||
|
|||
#if defined(__APPLE__) | |||
// On MacOSX systems we use disconnectx |
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.
Thanks for doing this. Do you mind changing this comment to "macOS" as I think that is how the OS is named these days.
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.
Done. I have pushed an update to this PR with this change.
That looks good to me. I'd suggest running some test repeat campaign on the CI to make sure this works as expected on all macOS versions that we support, and there's no regression on other OS. |
Maybe okay to add it to one test for disconnect but please don't change every test that failed, it's just not helpful. |
Done. I updated the PR to add it to just one test case. |
tier1, tier2, tier3 tests that were in progress against various different OS, completed without any related failures. I've additionally triggered a run with test repeat of 50, solely against macosx-x64 and macosx-aarch64. I'll let them run overnight and see how they go. |
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.
LGTM
@jaikiran 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 7 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
The test runs completed without any related failures. Thank you Alan and Daniel for the reviews. |
/integrate |
Going to push as commit 269eae6.
Your commit was automatically rebased without conflicts. |
Can I please get a review of this change with proposes to address the issue reported in https://bugs.openjdk.java.net/browse/JDK-8285515?
We have noticed that in the latest 12.4 Beta2 version of MacOSX, the implementation of
DatagramChannelImpl.disconnect
fails with an unexpected error.Internally, the disconnect is implemented as a call to
connect
by passing it a "null" address as suggested in the documentation ofman connect
. In previous versions of MacOSX, this call used to return aEADDRNOTAVAIL
errno and at the same time would correctly dissolve the connected association. TheEADDRNOTAVAIL
was then caught and intentionally ignored by the code in the JNI layer inDatagramChannelImpl.disconnect0
.In MacOSX 12.4 Beta 2 we are now seeing this
connect
call returnEINVAL
. This change in behaviour is noticed only for IPv4-mapped IPv6 addresses.The
man connect
documentation on MacOSX states that evendisconnectx
can be used to disconnect datagram sockets. The commit here does that change to usedisconnectx
for MacOSX. Tests have been successfully run on some older Mac setups to make sure this change passes there as well.Currently
tier1
,tier2
andtier3
run is in progress across various OS.No additional tests have been added for this change since the many existing (failing) tests already cover this use case.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8445/head:pull/8445
$ git checkout pull/8445
Update a local copy of the PR:
$ git checkout pull/8445
$ git pull https://git.openjdk.java.net/jdk pull/8445/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 8445
View PR using the GUI difftool:
$ git pr show -t 8445
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8445.diff