-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8245194: Unix domain socket channel implementation #52
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
8245194: Unix domain socket channel implementation #52
Conversation
…Alan's email 06/09/2020
… comment this morning
👋 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 |
/csr needed |
@Michael-Mc-Mahon the issue for this pull request, JDK-8245194, already has an approved CSR request: JDK-8247942 |
…automatically bound server sockets are created. After this change it is no longer necessary to specify the location in individual tests.
Mailing list message from Alan Bateman on nio-dev: On 07/09/2020 13:14, Michael McMahon wrote:
The file system provider shouldn't know anything about Unix domain I think it would be useful to also summarize how the bind/connect works -Alan. |
I'm not sure what to call the method then. It returns a UTF-8 string Since sockets are file system entities, why not have socket in the method name? What about getByteArrayForSocket() ?
Right
Yes, that is how it is working currently. We check the length in native code Michael.
|
Mailing list message from Alan Bateman on nio-dev: On 24/09/2020 13:17, Michael McMahon wrote: src/java.base/share/classes/sun/nio/ch/InetSocketChannelImpl.java src/java.base/share/classes/sun/net/ext/ExtendedSocketOptions.java src/java.base/share/classes/sun/net/util/SocketExceptions.java src/java.base/share/classes/sun/nio/ch/SelectorProviderImpl.java src/java.base/share/classes/sun/nio/fs/AbstractFileSystemProvider.java src/java.base/share/native/libnet/net_util.h src/java.base/unix/classes/sun/nio/ch/UnixDomainHelper.java src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java src/java.base/windows/classes/sun/nio/ch/PipeImpl.java src/java.base/windows/native/libnet/net_util_md.h src/java.base/windows/native/libnio/ch/Net.c src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java test/jdk/com/sun/nio/sctp/SctpServerChannel/NonBlockingAccept.java test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/ConnectionPoolTest.java I'm still working through new Unix* code and the tests so more comments -Alan |
Hi Alan, Thanks for the comments. Assume all are accepted, except as queried below
struct sockaddr_un is declared in <afunix.h> on Windows and <sys/un.h> I suspect the definition is only in fairly recent SDKs on Windows, and I'm not sure
The problem here is that the Java impl of UnixDomainHelper is platform As regards hard-coding of /tmp and /var/tmp, I think we need to be very What about "jdk.nio.unixdomain.tmpdir" for the property name?
Explained above <afunix.h> is Windows only.
I had changed this file, but reverted all changes in the last version. I don't
Thanks for the review. I'm making the changes as described, except where noted Michael |
(1) rename UnixDomainHelper to UnixDomainSocketsUtil (2) remove hardcoded /tmp and /var/tmp paths from UnixDomainSocketsUtil (3) replace (2) with documented system/networking properties (4) Small update to UnixDomainSocketAddress API (5) CSR for (3) and (4) submitted at JDK-8253930 (6) Update build to generate net.properties from shared net.properties.common plus platform specific additions.
test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/Launcher.java
Outdated
Show resolved
Hide resolved
- test updates from Chris
src/java.base/windows/classes/sun/nio/ch/WindowsSelectorImpl.java
Outdated
Show resolved
Hide resolved
/integrate |
@Michael-Mc-Mahon Since your change was applied there have been 29 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 6bb7e45. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
* Add a PEAParanoid mode. In this mode, C2 aborts when it is expanding an object which has been materialized at least once. This is not supposed to happen and will have allocation duplication on some paths. There are two reasons for this. 1) because we skip passive materialization, an object PHI may render the object NSR and hinders it from eliminating. if it's a reducible phi, try to use Cesar's patch to mitigate it. 2) we don't support recursive materialization like Graal PEA. I added a new testcase 'CompositeObjects' to demonstrate it. * fix formatting issue --------- Co-authored-by: Xin Liu <xxinliu@amazon.com>
Continuing this review as a PR on github with the comments below incorporated. I expect there will be a few more iterations before integrating.
On 06/09/2020 19:47, Alan Bateman wrote:
Maybe it would be better to just use the path returned from toString() and do the conversion to UTF-8 externally. That would leave WindowsPath unchanged.
Okay, I gave the method a name that is specific to Unix domain sockets because this UTF-8 strangeness is not likely to be useful by other components.
Okay, that does simplify it a bit.
Thanks,
Michael.
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/52/head:pull/52
$ git checkout pull/52