summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mixlib/shellout/windows.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/mixlib/shellout/windows.rb b/lib/mixlib/shellout/windows.rb
index 137aaa9..bf74653 100644
--- a/lib/mixlib/shellout/windows.rb
+++ b/lib/mixlib/shellout/windows.rb
@@ -111,6 +111,12 @@ module Mixlib
when WAIT_TIMEOUT
# Kill the process
if (Time.now - start_wait) > timeout
+ begin
+ Process.kill(:KILL, process.process_id)
+ rescue Errno::EIO
+ logger.warn("Failed to kill timed out process #{process.process_id}") if logger
+ end
+
raise Mixlib::ShellOut::CommandTimeout, "command timed out:\n#{format_for_exception}"
end