From 48b0cb750cd7d01db1f7ee5067c3d80139a51de9 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sun, 2 Oct 2016 08:54:20 -0700 Subject: [PATCH] (re)add post-watchdog-launch sleep to Windows async_wrapper (#5122) fixed apparent race where subprocess appears to never start --- lib/ansible/modules/windows/async_wrapper.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/modules/windows/async_wrapper.ps1 b/lib/ansible/modules/windows/async_wrapper.ps1 index a4f90094837..54d820fe58b 100644 --- a/lib/ansible/modules/windows/async_wrapper.ps1 +++ b/lib/ansible/modules/windows/async_wrapper.ps1 @@ -324,6 +324,10 @@ Function Start-Watchdog { # FUTURE: use CreateProcess + stream redirection to watch for/return quick watchdog failures? $result = $([wmiclass]"Win32_Process").Create($exec_path, $null, $pstartup) + # On fast + idle machines, the process never starts without this delay. Hopefully the switch to + # Win32 process launch will make this unnecessary. + Sleep -Seconds 1 + $watchdog_pid = $result.ProcessId return $watchdog_pid