Repository navigation
fix(ci): bound Windows monitor termination - #553
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Windows CI monitor called
Process.Kill(true)synchronously after a case or command deadline. If that call did not return, the monitor could not exit and reach the artifact upload step.Run termination on a background worker and bound the total termination wait to ten seconds. A returned call retains a root-exit observation of up to five seconds within the remaining budget; a nonreturning or thrown call records its own checkpoint. All timeout paths flush the final
stage_exitrecord and exit 124 without joining the worker, disposing the shared process, or taking another CIM sample. Normal commands retain their native exit codes and inherited output. Exit 124 does not claim that every descendant stopped; residual cleanup belongs to the runner.The actual termination helper has real-child regressions for native termination, a never-returning call, an exception, and a slow returned call whose target remains alive. They observe root
exitseparately from pipeclose, enforce the total budget, retain evidence in both sinks and clean up the synthetic targets. The existing command and blocked-worker assertions remain, with the final stage checkpoint now also checked in stdout.Validation and evidence:
CI=1 pnpm run checkwith PowerShell 7.6.9 enabled: 2,523 tests, including the four actual-helper cases, and 18 mock behavior cases passed.experiments/windows-handles/README.md, with repeatable scripts. The second run passed: inherited handles delayed the next step 5533 ms versus 488 ms with files; injected nonreturning termination waited 10005 ms and the root exited 124 another 99 ms after its checkpoint while the target and pipes were still alive.close, so it could not determine whether the root was still alive. The second collector recordsexitandcloseindependently.This is task #97. The old 25-minute cancellations remain unexplained; this change bounds one monitor operation and improves evidence retention without claiming a causal fix or guaranteed upload if the runner itself fails. Product probe diagnostics are separate in PR #552.