JShell: JDIConnection leaks the input transfer thread on close

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: 9
    • Component/s: 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.

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

              Created:
              Updated: