JMX RMI Connections 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. Changing the base RMI implementation may not be desirable at this time. JMX can use a new ClientSocketFactory for RMI which implements the connect timeout, which can recognise a new JMX-specific property `com.sun.management.jmxremote.rmi.tcpConnectTimeout` (named like the existing com.sun.management.jmxremote... properties) Defaulting to a 1 minute timeout on connect has no effect on existing tests, and should go unnoticed unless there really is a significant connection delay. Specifying zero for the new System Property will use the old technique of a connect with no timeout. This can be tested, but it is not realistically usable: although specifying a 1 millisecond timeout will often fail (as expected/desired for the test), it will very often pass as the connection happens immediately. ------------- Commit messages: - whitespace - remove commented out code - complete class rename - 8316649: JMX connection timeout cannot be changed and uses the default of 0 (infinite) Changes: https://git.openjdk.org/jdk/pull/16856/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16856&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8316649 Stats: 72 lines in 2 files changed: 68 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/16856.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16856/head:pull/16856 PR: https://git.openjdk.org/jdk/pull/16856