Closed System.out causes child process to hang on Windows

XMLWordPrintable

    • Type: CSR
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Component/s: core-libs
    • None
    • behavioral
    • minimal
    • Hide
      On all platforms other than Windows, the behavior is already as specified in this CSR.

      On Windows, the current behavior is undesirable (child process hangs). It's hard to imagine programs will depend on such a behavior,
      Show
      On all platforms other than Windows, the behavior is already as specified in this CSR. On Windows, the current behavior is undesirable (child process hangs). It's hard to imagine programs will depend on such a behavior,
    • Java API
    • SE

      Summary

      Add API note about the behavior of a child process built with ProcessBuilder::inheritIO() when the parent process's System.out and/or System.err have been closed.

      Problem

      The behavior was not clearly specified, and on Windows the child process hangs unintentionally.

      Solution

      Add an API note to clearly specify the expected behavior

      Specification

      Add the following to the JavaDoc of ProcessBuilder::inheritIO()

           * @apiNote
           * When the process is {@link #start started}, 
           * if {#code System.out} and/or {#code System.err} have been
           * closed in the current process, the corresponding output
           * in the subprocess will be discarded.
      

            Assignee:
            Ioi Lam
            Reporter:
            Ioi Lam
            Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: