-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8336817: Several methods on DatagramSocket and MulticastSocket do not specify behaviour when already closed or connected #20543
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
/csr needed |
👋 Welcome back jpai! A progress list of the required criteria for merging this PR into |
@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 85 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@jaikiran has indicated that a compatibility and specification (CSR) request is needed for this pull request. @jaikiran please create a CSR request for issue JDK-8336817 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
Webrevs
|
@@ -422,6 +422,10 @@ public void bind(SocketAddress addr) throws SocketException { | |||
* call to send or receive may throw a PortUnreachableException. Note, | |||
* there is no guarantee that the exception will be thrown. | |||
* | |||
* <p> If this socket is already connected, then this method will attempt to | |||
* connect to the passed address and if that attempt completes exceptionally, | |||
* then this socket will continue to be connected to the previously connected address. |
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.
I don't know if there are other implementations DatagramSocketImpl in the eco system but the text could potentially invalidate them. I think it would be better to say that if connect fails then the state of the DatagramSocket is unknown, it may or may not be connected to the address that it was previously connected to.
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.
Hello Alan,
I don't know if there are other implementations DatagramSocketImpl in the eco system but the text could potentially invalidate them.
I hadn't taken into account other implementations. I've now updated the PR to use the text that you suggested.
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.
This looks reasonable to me. Nice clarification.
@@ -422,6 +422,11 @@ public void bind(SocketAddress addr) throws SocketException { | |||
* call to send or receive may throw a PortUnreachableException. Note, | |||
* there is no guarantee that the exception will be thrown. | |||
* | |||
* <p> If this socket is already connected, then this method will attempt to | |||
* connect to the passed address and if the connect fails then the state of |
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.
A small suggestion is to say "given address" rather than "passed address" and I think break at this point so that "If this connect fails ..." is a new sentence.
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've updated the PR with this change. I'll now create the CSR for review.
When we did similar change in Socket/ServerSocket classes recently, Joe had suggested to add a note to the The CSR with these changes is now ready for review at https://bugs.openjdk.org/browse/JDK-8338397. |
Joe rightly noted in the CSR about MulticastSocket. It too required clarifications similar to what we have done in the DatagramSocket. I've now updated this PR to include those doc-only changes. |
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. One could argue that an I/O error encompasses the fact that the socket is closed, but what you have is fine, since "or the socket is closed" was added everywhere else.
The CSR has been approved. I took Alan's suggestion to update the title of the JBS issue and thus the CSR and this PR to more accurately state what this change now addresses. I'll go ahead and integrate this later today. |
/integrate |
Going to push as commit 686eb23.
Your commit was automatically rebased without conflicts. |
Can I please get a review of this doc-only change which updates the javadoc on several methods of the
java.net.DatagramSocket
class to match its current implementation?This addresses https://bugs.openjdk.org/browse/JDK-8336817.
I'll open a CSR once we settle on the proposed text.
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20543/head:pull/20543
$ git checkout pull/20543
Update a local copy of the PR:
$ git checkout pull/20543
$ git pull https://git.openjdk.org/jdk.git pull/20543/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20543
View PR using the GUI difftool:
$ git pr show -t 20543
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20543.diff
Webrev
Link to Webrev Comment