On Fri, 24 Nov 2023 12:13:56 GMT, Kevin Walls <kev...@openjdk.org> wrote:

>> (Look for socket factories in the module `jdk.management.agent`)
>
> OK yes, we also have: 
> java.rmi/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java
> with its own createSocket(String host, int port) method.  This is used if we 
> use JMX over SSL.
> 
> So SslRMIClientSocketFactory could specifically implement the connect timeout.
> 
> Next q, should it?  8-)
> 
> The reported hang and those I have seen in testing have only been in:
> sun.rmi.transport.tcp.TCPDirectSocketFactory.createSocket calling Socket.init.
> 
> javax/rmi/ssl/SslRMIClientSocketFactory.java reads some properties named 
> "javax.rmi.ssl.client...."
> so it would be odd for it to read 
> "sun.rmi.transport.tcp.initialConnectTimeout" I was proposing here.
> 
> It could implement "javax.rmi.ssl.client.initialConnectTimeout", or we could 
> leave SSL alone for now, possibly handling it in a separate issue if it's 
> wanted.

OK - sounds good. Meanwhile I had a look at the custom RMI Socket Factories 
used by the JMX Agent, and these are actually RMIServerSocketFactories, so 
having a timeout for connect there probably makes no sense.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16771#discussion_r1404331875

Reply via email to