Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8320580

JMX RMI Connections should have a connect timeout property

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P4 P4
    • None
    • core-svc
    • 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

            kevinw Kevin Walls
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: