adding rsockets support into JDK
Chris Hegarty
chris.hegarty at oracle.com
Wed Nov 28 16:57:57 UTC 2018
Lucy,
> On 23 Nov 2018, at 21:38, Lu, Yingqi <yingqi.lu at intel.com> wrote:
>
> ...
>
> I completed the version 19 of the patch at http://cr.openjdk.java.net/~ylu/8195160.19
I encountered a few issues with the catching and handling of
ExceptionInInitializerError [1] [2], as well as the fact that since
class initialization fails subsequent calls to the factory methods will
throw NoClassDefFoundError ( which is not good ).
Rather than allow the UnsupportedOperationException to be thrown during
class initialization it is better to allow class initialization to
complete successfully ( capturing the error ) and then prevent instances
of RDMA socket and channel implementations form being constructed. Since
the changes are a little involved I created a webrev so that you can
more easily see them
https://cr.openjdk.java.net/~chegar/rsocket/webrev.19.1/
( based on webrev .91 )
I also think that making RdmaSocketImpl abstract ( and its socket option
related methods ) will be cleaner, since it ensures that subclasses
will override the methods. I also moved the supported options lists into
their appropriate subclass. This is in the webrev too. And updated
and existing test to ensure that multiple calls to the factory methods
behave as expected.
-Chris
[1] FAILED: jdk/net/RdmaSockets/rsocket/RdmaSocketsTest.java
java.lang.NoClassDefFoundError: Could not initialize class jdk.internal.net.rdma.RdmaSocketChannelImpl
at jdk.net/jdk.internal.net.rdma.LinuxRdmaPollSelectorProvider.openSocketChannel(LinuxRdmaPollSelectorProvider.java:53)
at jdk.net/jdk.internal.net.rdma.RdmaPollSelectorProvider.openSocketChannel(RdmaPollSelectorProvider.java:65)
at jdk.net/jdk.net.RdmaSockets.openSocketChannel(RdmaSockets.java:129)
at RdmaSocketsTest.main(RdmaSocketsTest.java:64)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:246)
at java.base/java.lang.Thread.run(Thread.java:835)
[2] FAILED: jdk/net/RdmaSockets/rsocket/SocketOption/OptionsTest.java
FAILED: jdk/net/RdmaSockets/rsocket/SocketOption/UnsupportedOptionsTest.java
java.lang.ExceptionInInitializerError
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:325)
at jdk.net/jdk.net.RdmaSocketOptions$PlatformRdmaSocketOptions.newInstance(RdmaSocketOptions.java:241)
at jdk.net/jdk.net.RdmaSocketOptions$PlatformRdmaSocketOptions.create(RdmaSocketOptions.java:256)
at jdk.net/jdk.net.RdmaSocketOptions$PlatformRdmaSocketOptions.<clinit>(RdmaSocketOptions.java:260)
at jdk.net/jdk.net.RdmaSocketOptions.<clinit>(RdmaSocketOptions.java:118)
at UnsupportedOptionsTest.<clinit>(UnsupportedOptionsTest.java:55)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.UnsupportedOperationException: librdmacm.so.1: cannot open shared object file: No such file or directory
at jdk.net/jdk.net.LinuxRdmaSocketOptions.init(Native Method)
at jdk.net/jdk.net.LinuxRdmaSocketOptions.<clinit>(LinuxRdmaSocketOptions.java:51)
... 13 more
More information about the nio-dev
mailing list