mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-16 06:19:21 +00:00
fix(ci): kill the Windows child via taskkill, not a signal
Review found kill -TERM against a native Windows binary (bun.exe) under Git Bash is best-effort thread injection, not a real signal, and can fail to land -- reproducing the exact hang this watchdog exists to prevent. taskkill //F //T is a real TerminateProcess call. Also: cite the run id instead of a branch name (branches get deleted), and add the missing shell: bash the repo's other Windows steps already set explicitly.
This commit is contained in:
@@ -18,7 +18,15 @@ run_with_timeout() {
|
||||
local elapsed=0
|
||||
while kill -0 "$pid" 2>/dev/null; do
|
||||
if ((elapsed >= seconds)); then
|
||||
kill -TERM "$pid" 2>/dev/null
|
||||
# Git Bash's `kill -TERM` on a native Windows binary (bun.exe) is a
|
||||
# best-effort thread-injection emulation, not a real signal, and can
|
||||
# fail to land -- the exact hang this function exists to prevent.
|
||||
# taskkill //T (kills the child tree) //F (TerminateProcess) is real.
|
||||
if [[ "${OS:-}" == "Windows_NT" ]]; then
|
||||
taskkill //F //T //PID "$pid" 2>/dev/null
|
||||
else
|
||||
kill -TERM "$pid" 2>/dev/null
|
||||
fi
|
||||
wait "$pid" 2>/dev/null
|
||||
return 124
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user