> The teardown of a Process launched by `ProcessBuilder` includes the closing 
> of streams and ensuring the termination of the process is the responsibility 
> of the caller. The `Process.close()` method provides a clear and obvious way 
> to ensure all the streams are closed and the process terminated.
> 
> The try-with-resources statement is frequently used to open streams and 
> ensure they are closed on exiting the block. By implementing 
> `AutoClosable.close()` the completeness of closing the streams and process 
> termination can be done by try-with-resources.
> 
> The actions of the `close()` method are to close each stream and destroy the 
> process if it has not terminated.

Roger Riggs has updated the pull request with a new target base due to a merge 
or a rebase. The incremental webrev excludes the unrelated changes brought in 
by the merge/rebase. The pull request contains 32 additional commits since the 
last revision:

 - Doc update to use "interrupted status" terminology in alignment with 
JDK-8370568.
 - Merge branch 'master' into 8364361-process-autocloseable
 - Corrected ProcessCloseTest to expect a racy result from "echo abc" and 
Process.close.
 - "type" on Windows isn't what I'm looking for.
 - Improve robustness of ProcessCloseTest:
   Replace "cat <filename>" on Linux with "type" on Windows.
   Replace "cat -" with builtin Child command, not a native program.
 - Review comment updates to handle cases where stream close methods might
   throw exceptions other then IOException and add them to the suppressed 
exceptions.
   Update the spec and @implSpec to be clear about exception handling
   and how the process is terminated with destroyForcibly.
 - Adopt review suggestions for javadoc wording.
   Refactor the utility method to wait for the process, return true on 
termination, false on interrupt.
   Various updates to the test related to logging of output when a test fails.
 - Incremental update to make it clear that if it is necessary
   to forcibly destroy the process, close continues to wait for the
   process to terminate.
 - Merge branch 'master' into 8364361-process-autocloseable
 - Modify close to waitFor process to exit.
   If the waitFor is interrupted, destroy the process (forcibly).
   Wait indefinately for the process to terminate.
   
   Updated tests with exit status indicating waiting for termination
   due to reduction in racy exits.
 - ... and 22 more: https://git.openjdk.org/jdk/compare/3975b214...b919c57d

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/26649/files
  - new: https://git.openjdk.org/jdk/pull/26649/files/10cf85d9..b919c57d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26649&range=22
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26649&range=21-22

  Stats: 23479 lines in 628 files changed: 13743 ins; 5630 del; 4106 mod
  Patch: https://git.openjdk.org/jdk/pull/26649.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26649/head:pull/26649

PR: https://git.openjdk.org/jdk/pull/26649

Reply via email to