Skip to content

Commit

Permalink
Kill process upon shutdown (apache#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
srkukarni authored and sijie committed Mar 4, 2018
1 parent d2f32e8 commit a2ed4c2
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class ProcessFunctionContainer implements FunctionContainer {
*/
@Override
public void start() throws Exception {
Runtime.getRuntime().addShutdownHook(new Thread(() -> process.destroy()));
try {
log.info("ProcessBuilder starting the process with args {}", String.join(" ", processBuilder.command()));
process = processBuilder.start();
Expand Down

0 comments on commit a2ed4c2

Please sign in to comment.