RFR: 8316649: JMX connection timeout cannot be changed and uses the default of 0 (infinite)
Kevin Walls
kevinw at openjdk.org
Fri Dec 1 10:09:15 UTC 2023
On Tue, 21 Nov 2023 17:57:32 GMT, Kevin Walls <kevinw at openjdk.org> wrote:
> RMI Connections (in general) should use a timeout on the Socket connect call by default.
>
> JMX connections use RMI and some connection failures never terminate. The hang described in 8316649 is hard to reproduce manually: the description says it can be caused by a firewall that never returns a response.
>
> src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPChannel.java
> has other timeouts but nothing to control the initial Socket connect.
>
> Defaulting to a 1 minute timeout on connect has no effect on existing tests for RMI and JMX, and should go unnoticed in applications unless there really is a significant connection delay. Specifying zero for the new System Property sun.rmi.transport.tcp.initialConnectTimeout uses the old code path of a connect with no timeout.
>
> I have a test, but it is not realistically usable: although specifying a 1 millisecond timeout will often fail (as expected/desired for the test), it will often pass as the connection happens immediately.
Thanks for the feedback.
Additionally, there can be a concern that affecting all RMI activity with the timeout property could produce unintended side-effects.
At the moment the demand for the timeout is not strong, and the behaviour is what it has been for many years, so I am going to close this without progressing it.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16771#issuecomment-1835814563
More information about the core-libs-dev
mailing list