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
8255758: JEP 380 spec clarifications #1021
8255758: JEP 380 spec clarifications #1021
Conversation
👋 Welcome back michaelm! A progress list of the required criteria for merging this PR into |
@Michael-Mc-Mahon The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
java.nio.channels.ServerSocketChannel#bind(SocketAddress,int) ServerSocketChannel.bind} | ||
is called with a {@code null} address parameter. In this case, the system |
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.
doesn't it also happen when it is called with a UnixDomainSocketAddress that has an empty path?
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.
No, an empty path signifies an unnamed address and only client sockets (SocketChannels) are allowed to be unnamed.
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.
You get a BindException if you try to bind a ServerSocketChannel to the unnamed address. But, the exception message is "unhelpful". I would like to fix that.
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.
Ah good. I missed that paragraph was only talking about the server sockets.
<a id="Unixdomain"></a> | ||
<H2>Unix domain sockets</H2> | ||
<P>There are a number of system (and networking) properties that affect the behavior of | ||
channels to <i>Unix domain</i> server sockets when binding <i>automatically</i>. |
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.
Should this also mention implicit binding?
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'm not sure, as the system properties don't affect implicit binding, but I would have liked to have a place to "explain" all aspects of binding of Unix domain sockets/server-sockets. Maybe, I could add a paragraph at the end, just as an aside or note.
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.
Oh - I was assuming that implicit binding & automatic binding were identical - just had a different trigger. Maybe it would be worth spelling out that implicit binding is not affected by the property then? For my own curiosity - is it because automatic binding is performed by our java implementation while implicit binding is performed by the system?
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.
These concepts aren't new by the way. "Implicit" binding is when you create a client socket and connect it without calling bind first. This is not possible with server sockets.
"Automatic" binding is when you bind a server socket with a null address. All the above is the same for tcp and unix domain. tcp has more options relating to the interface and specifying a port = 0. These cases don't exist for unix domain.
Just to add, one other point. It is also possible to automatically bind a client socket (either tcp or unix) (ie bind(null)) There is a small conceptual difference here between tcp and unix. With tcp you get a random port number, but with unix domain you get an unnamed socket address.
src/java.base/share/classes/java/net/doc-files/net-properties.html
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/java/net/doc-files/net-properties.html
Outdated
Show resolved
Hide resolved
@Michael-Mc-Mahon 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 24 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 |
/csr needed |
@Michael-Mc-Mahon has indicated that a compatibility and specification (CSR) request is needed for this pull request. |
Webrevs
|
The clarification to the SecurityException looks good. The API docs specify that bind(null) will "bind to an automatically assigned socket address". Would it be better to lead with that phrase in the properties doc rather than switching to "automatically bound". That might also avoid it getting confused with an implicitly bound sockets. A minor comment on the test is that "peer" might be a better than "acc1". |
I've just updated the spec per these comments and will update the CSR accordingly. Thx. |
src/java.base/share/classes/java/net/doc-files/net-properties.html
Outdated
Show resolved
Hide resolved
Calling {@link java.nio.channels.ServerSocketChannel#bind(SocketAddress,int) ServerSocketChannel.bind} | ||
with a {@code null} address parameter will bind to an <i>automatically assigned</i> socket address. | ||
For Unix domain sockets, this means a unique path in some predefined system temporary directory. | ||
<P>There are a number of system (and networking) properties that affect this behavior. |
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.
"There are are a number of system properties ..." follows directly from the previous sentence so I assume you don't want a paragraph break here.
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.
Ok, that's fine.
For Unix domain sockets, this means a unique path in some predefined system temporary directory. | ||
<P>There are a number of system (and networking) properties that affect this behavior. | ||
<p> | ||
Bearing in mind that Unix domain socket addresses are limited in length to approximately 100 |
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 think "Bearing in mind" should be dropped here and just say that Unix domain sockets are typically limited to a file path of 100 characters (typically it is bytes that may be too subtle for the context).
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.
Ok. Thanks
/integrate |
@Michael-Mc-Mahon Since your change was applied there have been 24 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 9d0ee66. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Minor spec changes from spec approved in initial CSR
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1021/head:pull/1021
$ git checkout pull/1021