adding rsockets support into JDK

Alan Bateman Alan.Bateman at oracle.com
Thu Mar 8 21:24:38 UTC 2018


On 08/03/2018 17:21, Lu, Yingqi wrote:
>
> Hi Alan,
>
> Currently, rsocket does not support epoll, which is why I use legacy 
> poll/rpoll method instead on java.nio.channels.Selector.
>
> Would you please share a little more details on how it impacts 
> asynchronous close of RDMA sockets configured blocking? Do you refer 
> to a specific type of the SocketChannel or it impacts all the nio 
> socket channels?
>
>
All selectable channels associated with a selector provider can be 
registered with a Selector associated with the same provider. I don't 
think a separate selector provider will work because you'd still have 
the issue of multiplexing rsockets with datagram channels created by the 
same provider. So that would one will need a bit of consideration to 
avoid an overly complicated solution.

The legacy poll based Selector has not been used for several releases 
and is not included in the Linux build - this is why you had to change 
CompileJavaModules.gmk to un-exclude these sources from compilation. The 
poll based Selector has a number of issues and I suspect will need work 
if it is to come back to life. Also it also won't scale like the epoll 
Selector but that might not be an issue if there only a small number of 
connections over the fabric.

My comment on asynchronous close relates to blocking I/O operations 
which is a two step process to avoid I/O on a recycled file descriptor 
during the close. I would expect dup2 to work but it will need to be 
checked. At least in JDK 11, it won't normally attempt to dup2 a file 
descriptor for a socket registered with a Selector but there are bunch 
of corner cases that may need investigation - one example is where a 
channel is registered with a Selector, its selection key is canceled, 
the channel configured blocking, and a blocking I/O operation initiated. 
This type of scenario could mean the implementation attempts to dup2 a 
file descriptor that you are rpoll-ing. I've been through all these 
cases in the past with SDP but I can't say if there will be issues with 
rsockets.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20180308/2c798254/attachment-0001.html>


More information about the nio-dev mailing list