-
CSR
-
Resolution: Withdrawn
-
P4
-
None
-
None
-
behavioral
-
minimal
-
System or security property
-
Implementation
Closing this without implementing. There are side-effects in the different ideas considered for implementing this. 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.
Summary
Provide a new System Property com.sun.management.jmxremote.rmi.tcpConnectTimeout
, defaulting to 1 minute, which sets a timeout on the initial socket connect of a non-SSL JMX RMI client.
Problem
JMX using the JDK's standard RMI Connector, connects a TCP network socket with no timeout value. This is reported to lead to infinite hangs with some network or firewall failures. It is reliant on the OS or system libraries to produce an error in a timely manner, which does not always happen.
There is no programmatic method for the JMX code, or RMI applications in general, to get this level of control over the network socket.
The simple solution is to implement a new RMI Client SocketFactory with a timeout in Socket connect, with a System property to tune its value where necessary.
Solution
Add a System Property com.sun.management.jmxremote.rmi.tcpConnectTimeout
which is recognised in a new JMX RMI Client SocketFactory. A default value should permit even reasonably slow connections to continue with no noticeable change. The value can be set to zero to use the same code path as before, where a socket is created with no timeout.
Specification
System Property com.sun.management.jmxremote.rmi.tcpConnectTimeout
- If non-zero, is a value in milliseconds passed to Socket.connect().
- If zero, a socket is created with no timeout.
- Default to 1 minute (60000ms)
The Property is read once in the new class JMXPlainRMIClientSocketFactory and assigned to a static value. This is in the same technique as other properties in the base RMI implementation, e.g. src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPChannel.java
- csr of
-
JDK-8316649 JMX connection timeout cannot be changed and uses the default of 0 (infinite)
- Closed