fix(setup): terminate stalled preflight once - #72
Conversation
Clear timeout ownership after bounded process termination so the finally block cannot repeat the five-second cleanup path. Preserve the same fail-closed exit code and signer integrity checks.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fe395e428
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| -WindowStyle Hidden -PassThru | ||
| if (-not $process.WaitForExit($TimeoutSeconds * 1000)) { | ||
| Stop-PreflightProcess $process | ||
| $process = $null |
There was a problem hiding this comment.
Confirm termination before clearing the process handle
When Windows signer inspection times out and taskkill itself exceeds five seconds, Stop-PreflightProcess kills taskkill and issues a silenced Stop-Process request but never waits for or rechecks the target's exit. Unconditionally clearing $process then prevents finally from retaining cleanup ownership, so a failed or asynchronous force-stop can leave the signer/provider running after Setup reports the timeout and can keep the redirected temporary files open. Only clear the handle after termination has been confirmed within the bounded cleanup period.
Useful? React with 👍 / 👎.
Summary
finallyVerification
uv run --locked python -m pytest tests/test_build_profiles.py -q(11 passed)git diff --checkImmediate blocker
Exact-SHA run 31738514446 showed the outer 10-second test timing out after two consecutive five-second cleanup attempts. The process object was not refreshed before
finally; clearing handled ownership makes the bounded path execute once.