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

8255758: JEP 380 spec clarifications #1021

Closed

Conversation

Michael-Mc-Mahon
Copy link
Member

@Michael-Mc-Mahon Michael-Mc-Mahon commented Nov 2, 2020

Minor spec changes from spec approved in initial CSR


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Testing

Linux x64 Linux x86 Windows x64 macOS x64
Build ⏳ (3/5 running) ⏳ (2/2 running) ⏳ (2/2 running) ⏳ (2/2 running)

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1021/head:pull/1021
$ git checkout pull/1021

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 2, 2020

👋 Welcome back michaelm! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 2, 2020

@Michael-Mc-Mahon The following labels will be automatically applied to this pull request:

  • net
  • nio

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.

@openjdk openjdk bot added nio nio-dev@openjdk.org net net-dev@openjdk.org labels Nov 2, 2020
Comment on lines 249 to 250
java.nio.channels.ServerSocketChannel#bind(SocketAddress,int) ServerSocketChannel.bind}
is called with a {@code null} address parameter. In this case, the system
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

@dfuch dfuch Nov 3, 2020

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>.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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.

@openjdk
Copy link

openjdk bot commented Nov 3, 2020

@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:

8255758: JEP 380 spec clarifications

Reviewed-by: dfuchs, alanb

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 master branch:

  • 3dcde55: 8256386: ARM32 tests fail with "bad AD file" after JDK-8223051
  • 53a3188: 8202471: (ann) Cannot read type annotations on generic receiver type's type variables
  • adb8561: 8253228: [JVMCI] provide more info on fatal JVMCI errors
  • a7422ac: 8255150: Add utility methods to check long indexes and ranges
  • 6d87856: 8256325: Remove duplicate asserts in PhaseMacroExpand::expand_macro_nodes
  • 5dbfae0: 8255058: C1: assert(is_virtual()) failed: type check
  • 4553fa0: 8256258: some missing NULL checks or asserts after CodeCache::find_blob_unsafe
  • 1228517: 8256274: C2: Optimize copying of the shared type dictionary
  • 537b40e: 8252588: HotSpot Style Guide should permit uniform initialization
  • c35e1a2: 8255947: [macos] Signed macOS jpackage app doesn't filter spurious '-psn' argument
  • ... and 14 more: https://git.openjdk.java.net/jdk/compare/ac3948930ef2b188401d67f20f730fefe7d15e1e...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 3, 2020
@Michael-Mc-Mahon Michael-Mc-Mahon marked this pull request as ready for review November 5, 2020 10:14
@Michael-Mc-Mahon
Copy link
Member Author

/csr needed

@openjdk openjdk bot added rfr Pull request is ready for review csr Pull request needs approved CSR before integration labels Nov 5, 2020
@openjdk
Copy link

openjdk bot commented Nov 5, 2020

@Michael-Mc-Mahon has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@Michael-Mc-Mahon please create a CSR request and add link to it in JDK-8255758. This pull request cannot be integrated until the CSR request is approved.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Nov 5, 2020
@mlbridge
Copy link

mlbridge bot commented Nov 5, 2020

Webrevs

@AlanBateman
Copy link
Contributor

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".

@Michael-Mc-Mahon
Copy link
Member Author

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.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Nov 16, 2020
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.
Copy link
Contributor

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.

Copy link
Member Author

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
Copy link
Contributor

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).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Thanks

@Michael-Mc-Mahon
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Nov 17, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 17, 2020
@Michael-Mc-Mahon Michael-Mc-Mahon deleted the 8255758-spec-change branch November 17, 2020 12:12
@openjdk
Copy link

openjdk bot commented Nov 17, 2020

@Michael-Mc-Mahon Since your change was applied there have been 24 commits pushed to the master branch:

  • 3dcde55: 8256386: ARM32 tests fail with "bad AD file" after JDK-8223051
  • 53a3188: 8202471: (ann) Cannot read type annotations on generic receiver type's type variables
  • adb8561: 8253228: [JVMCI] provide more info on fatal JVMCI errors
  • a7422ac: 8255150: Add utility methods to check long indexes and ranges
  • 6d87856: 8256325: Remove duplicate asserts in PhaseMacroExpand::expand_macro_nodes
  • 5dbfae0: 8255058: C1: assert(is_virtual()) failed: type check
  • 4553fa0: 8256258: some missing NULL checks or asserts after CodeCache::find_blob_unsafe
  • 1228517: 8256274: C2: Optimize copying of the shared type dictionary
  • 537b40e: 8252588: HotSpot Style Guide should permit uniform initialization
  • c35e1a2: 8255947: [macos] Signed macOS jpackage app doesn't filter spurious '-psn' argument
  • ... and 14 more: https://git.openjdk.java.net/jdk/compare/ac3948930ef2b188401d67f20f730fefe7d15e1e...master

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.

openjdk-notifier bot referenced this pull request Nov 17, 2020
Reviewed-by: dfuchs, alanb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated net net-dev@openjdk.org nio nio-dev@openjdk.org
3 participants