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

JMX RMI Remote Mbean server connection hangs if the server stops responding during a SSL Handshake

XMLWordPrintable

    • b04
    • x86_64
    • linux
    • Verified

      FULL PRODUCT VERSION :
      openjdk version "1.8.0_111"
      OpenJDK Runtime Environment (build 1.8.0_111-b15)
      OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux, RHEL 7

      A DESCRIPTION OF THE PROBLEM :
      Remote RMI server connection hangs if the server stops responding(goes out of network/crashes abruptly) during a SSL handshake. The connection hangs as the thread blocks at SocketInputStream.read and never times-out.

      The options of setting the system property sun.rmi.transport.tcp.handshakeTimeout and sun.rmi.transport.tcp.responseTimeout does not help here as the connection hangs before the java.net.Socket.setSoTimeout(int) is called based on these system properties. Refer the below thread dump.

      Shouldn't the value set by sun.rmi.transport.tcp.handshakeTimeout used to set the SoTimeout before the writing to the DataOutputStream which triggers SSL handshake if it's a SSL socket?

      The socketFactory to be used for the connection(to customize the socket) can't be decided and set at the client side always as the client socketFactory can be exported on the server side and serialized to client in the remote stub.

      "TaskRunnerThreadPool" #1391 prio=5 os_prio=0 tid=0x00007f6ebc494800 nid=0x24a2 runnable [0x00007f6da928a000]
         java.lang.Thread.State: RUNNABLE
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
      at java.net.SocketInputStream.read(SocketInputStream.java:171)
      at java.net.SocketInputStream.read(SocketInputStream.java:141)
      at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
      at sun.security.ssl.InputRecord.read(InputRecord.java:503)
      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
      - locked <0x00000006eb2394a8> (a java.lang.Object)
      at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
      - locked <0x00000006eb2395a0> (a java.lang.Object)
      at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:757)
      at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)
      - locked <0x00000006eb23b5f0> (a sun.security.ssl.AppOutputStream)
      at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
      at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
      - locked <0x00000006eb23b608> (a java.io.BufferedOutputStream)
      at java.io.DataOutputStream.flush(DataOutputStream.java:123)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:229)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
      at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)
      at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:1020)



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Refer the description.


      REPRODUCIBILITY :
      This bug can be reproduced often.

            djelinski Daniel Jelinski
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: