Process.destroy() on Unix closes the streams to the child process immediately. For a process that handles SIGTERM this cuts off communication via the streams even though the process may not terminate.
The closing of the streams, causes SIGPIPE in the child and it may terminate (though not because of SIGTERM).
The behavior closing the streams immediately upon calling destroy() is long standing and should be documented as implementation specific.
The closing of the streams, causes SIGPIPE in the child and it may terminate (though not because of SIGTERM).
The behavior closing the streams immediately upon calling destroy() is long standing and should be documented as implementation specific.
- relates to
-
JDK-8080569 java/lang/ProcessBuilder/DestroyTest.java fails with "RuntimeException: Process terminated prematurely"
-
- Resolved
-