adding rsockets support into JDK

Lu, Yingqi yingqi.lu at intel.com
Wed Dec 5 06:44:36 UTC 2018


Hi Chris,

For the null binding issue, I took a quick look. Depends on the value of InetAddress.preferIPv6Address, Inet6AddressImpl.anyLocalAddress() will return either IPv6 address or IPv4 address. However, value of InetAddress.preferIPv6Address does not relate to protocol family. I think this might be why we get IPv4 address when we expect to have IPv6 address during null binding.

Since both java.net.InetAddress and java.net.Socket are part of public JDK APIs, I am looking forward to your suggestions and guidance to solve the issue :)

Thank you for your help!

Lucy

From: nio-dev [mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of Lu, Yingqi
Sent: Tuesday, December 4, 2018 9:15 PM
To: Chris Hegarty <chris.hegarty at oracle.com>
Cc: Viswanathan, Sandhya <sandhya.viswanathan at intel.com>; nio-dev at openjdk.java.net; Aundhe, Shirish <shirish.aundhe at intel.com>; Kaczmarek, Eric <eric.kaczmarek at intel.com>
Subject: RE: adding rsockets support into JDK

Hi Chris,

Thank you for your feedback. Here is the version 24 of the patch: http://cr.openjdk.java.net/~ylu/8195160.24

In this version,


1.      I first applied Javadoc wording changes following Brian's suggestion from http://cr.openjdk.java.net/~bpb/8195160/webrev-22-delta/openjdk.patch I then regenerated the Javadoc at http://cr.openjdk.java.net/~ylu/rsocket_docs/api/jdk.net/jdk/net/package-summary.html and attached the updated zip file at CSR at https://bugs.openjdk.java.net/browse/JDK-8205186.


2.      Then, I applied the three patches from you in the order of 23.1, 23.2 and 23.3.



3.      I took a look at the first issue you found regarding to socket channel read does not return EOF at the end. I found that issue might not related to the current patch. I tested regular TCP socket channel with both JDK11 and current trunk and I saw the exact same issue.



4.      I am looking into the second issue you found with null binding.


Thanks,
Lucy

From: Chris Hegarty [mailto:chris.hegarty at oracle.com]
Sent: Tuesday, December 4, 2018 12:23 PM
To: Lu, Yingqi <yingqi.lu at intel.com<mailto:yingqi.lu at intel.com>>
Cc: Brian Burkhalter <brian.burkhalter at oracle.com<mailto:brian.burkhalter at oracle.com>>; Aundhe, Shirish <shirish.aundhe at intel.com<mailto:shirish.aundhe at intel.com>>; Viswanathan, Sandhya <sandhya.viswanathan at intel.com<mailto:sandhya.viswanathan at intel.com>>; nio-dev at openjdk.java.net<mailto:nio-dev at openjdk.java.net>; Kaczmarek, Eric <eric.kaczmarek at intel.com<mailto:eric.kaczmarek at intel.com>>
Subject: Re: adding rsockets support into JDK

Lucy,

On 4 Dec 2018, at 03:05, Lu, Yingqi <yingqi.lu at intel.com<mailto:yingqi.lu at intel.com>> wrote:

Hi Brian,

Thank you for the quick check. I forgot to add RdmaSocketImpl.c into the original patch file.

The patch is updated at the same link: http://cr.openjdk.java.net/~ylu/8195160.23/. Please let me know if you see any issues with the updated version.


Finally, I have an environment where I can build and run the tests for
this code. I need to circle back and document this, but for now I
can successfully create an rsocket and run the java tests.

I am continuing to review the code, but here are a few comments so far:

1) BasicSocketChannelTest.java

  There is a race in the test code. Sometimes the test fails with an
  exception when it tries to shutdown the input/output of the client
  socket/channel. The reason is that the main thread may have already
  closed the socket/channel. While fixing the race I took the liberty
  of refactoring the test a little. It passes successfully, reliably, now
  in my environment.

    https://cr.openjdk.java.net/~chegar/rsocket/webrev.23.1/

  Note: I've left a TODO comment in the test. Read to EOF is not working
  as I would expect ( the original version of the test did not exercise
  this). I'll revisit this later.

2) Test consistency of API exception, across all platforms.

  I added a test to ensure that NPE and other API exceptions are being
  thrown as expected. This test can be run on all platforms, so it is
  not Linux specific. I used testng, very nice for test kinda tests.

    https://cr.openjdk.java.net/~chegar/rsocket/webrev.23.2/

3) Handling of null binding, automatically assigned address.

  Handling of null binding is a bit tricky now that we have protocol
  family support. The correct InetXAddress "any local address" needs to
  be created. I added a test and a little refactoring. If you run the
  test without any source changes you will be able to see the issues.

    https://cr.openjdk.java.net/~chegar/rsocket/webrev.23.3/

  Note: There is still an open issue, ToDo, with java.net.Socket. You
  can see this by a small comment in the test. I'll revisit this later.

-Chris.

P.S. The above webrevs were created from patches in my patch queue, and
should apply cleanly to version 23 if applied in order.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20181205/37befc4f/attachment-0001.html>


More information about the nio-dev mailing list