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

JShell: JDIConnection leaks the input transfer thread on close

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 9
    • tools
    • None

      The thread launched in JDIConnection.readRemoteInput() never terminates.

      If JDIConnection is repeatedly created, started, and closed -- as in a test, or a long running user session -- the process will lockup, out of threads.

      The read is from InputStream (usually System.in) and it is a well known problem that there is no general way to interrupt InputStream.read(..), nor a specific way to interrupt System.in. A polling approach could be used, with possible performance implications:
          read(buf, 0, inputStream.available())
      Or maybe a hybrid approach: long poll and if any input is detected (rare in practice) switch to the current approach.

      Assigned to Jan for evaluation, may assign back.

            jlahoda Jan Lahoda
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: