Repository navigation
Check a killed program's tree job too, and warn when Windows won't end it - #133
Merged
Merged
Conversation
…d it A time-limit kill or a force-stop whose tree job Windows wouldn't end fell back to taskkill /T, which misses a child whose parent has already exited, and counted the kill as complete. After every kill the tree job is now ended again (a second TerminateJobObject fails only on a refusal), and a refusal is warned about once per session, sharing -KillTreeOnExit's warning for the same refusal.
The kit's and the C#'s comments are cut to what the code does and why, in a sentence or two, with history narration taken out; help blocks are unchanged. Four harness comments that told what the code used to do now say what the test checks.
The harness watchdog no longer takes a beat file removed at the end of a run for a hang. The batch groups repeated start failures by the innermost message, which a rollback's note naming the process doesn't change. Invoke-PkProcessWithTimeout's cleanup names a stopped script, not a force-stop, in its warning, and its time-limit error says when the program couldn't be killed. Stop-PkProgramTree's comment names the force-stop's copy of its check.
…canceled the American way
A stale note on who reads Stop-PkProcessTreeCore's result, an empty catch that lost its reason, Stop-PkJobProcess's out-of-date header, empty harness catches with no reason, and long comment blocks in the harness, the C# and the workflows cut to a sentence or two.
Comments that leaned on unexplained shorthand now name what they mean (the function, key, switch or limit), several that no longer matched their code are corrected (the loop's three start paths, a leaked-value example, the paused handler thread), and two that cited version numbers say which PowerShell.
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.
What was wrong
A time-limit kill (the dispatcher's, the batch's or
Invoke-PkProcessWithTimeout's) or an abort's force-stop ends a program through its own Job Object. If Windows wouldn't end that Job Object, the kill fell back totaskkill /T. That kills the program and its running children, but misses a child whose parent has already exited. The kill still counted as complete, with no warning. The README says both kill a program "and anything it started".What changed
-KillTreeOnExit's once-per-session warning for the same refusal, so you get one or the other, not both.TimedOut.Invoke-PkProcessWithTimeout's cleanup names a stopped script, not a force-stop, in its warning.How it was tested
Six new section BJ assertions. A program runs on while its child starts a tagged
pingthrough a.cmdfile and exits at once. Each case kills the program:Invoke-PkProcessWithTimeout's time limit.Each case runs with and without
TestFailTerminate. Without it, nothing is left running and there's no warning. With it, the ping is left running, there's exactly one warning, and the test kills the ping by its tag.Before the fix (main's kit with the new harness), on 5.1 and 7 alike:
After, and again after the review's fixes and the comment passes: the full harness passes on Windows PowerShell 5.1 and PowerShell 7 (812 assertions each). A second review pass found no code issues.
Build/Update-ParallelKitCSharp.ps1 -Compilebuilds the C#, which changed only in comments, with no warnings.