From 2ea84fa7a0789a68aa1317c6c388ef533f20fade Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 1 Mar 2017 14:53:35 -0500 Subject: [PATCH] 2267 added logging message for interrupted waitFor in ExecUtil --- Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java index 85a6e6f690..3a9e308d59 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java @@ -163,6 +163,11 @@ public final class ExecUtil { process.waitFor(timeOut, units); if (process.isAlive() && terminator.shouldTerminateProcess()) { killProcess(process); + try { + process.waitFor(); //waiting to help ensure process is shutdown before calling interrupt() or returning + } catch (InterruptedException exx) { + Logger.getLogger(ExecUtil.class.getName()).log(Level.INFO, String.format("Wait for process termination following killProcess was interrupted for command %s", processBuilder.command().get(0))); + } } } while (process.isAlive()); } catch (InterruptedException ex) { @@ -172,6 +177,7 @@ public final class ExecUtil { try { process.waitFor(); //waiting to help ensure process is shutdown before calling interrupt() or returning } catch (InterruptedException exx) { + Logger.getLogger(ExecUtil.class.getName()).log(Level.INFO, String.format("Wait for process termination following killProcess was interrupted for command %s", processBuilder.command().get(0))); } Logger.getLogger(ExecUtil.class.getName()).log(Level.INFO, "Thread interrupted while running {0}", processBuilder.command().get(0)); // NON-NLS Thread.currentThread().interrupt();