Repository navigation
Check for an abort before each group the dispatcher fetches - #128
Merged
Merged
Conversation
…fer only in case A case-sensitive [hashtable]::new() job with 'canceltoken' got the kit's own token in its place, since the check used the job's own comparer and the worker's copy is case-insensitive. Two keys differing only in case collapsed into one, the later silently winning; such a job is now refused, up front for -JobParams and as it arrives for -NextJobProvider.
When -MaxOutputChars' head would end on the first half of a surrogate pair, it turned that half away but the tail kept its own size, so output exactly as long as the cap lost the pair. The tail now takes the slot the head turns away.
The group-fetch loop tested only the token, which is cancelled after it, so an abort raised by -GroupProvider, -JobBuilder, -GroupCompleteCallback or -GroupReleaseCheck still asked -GroupProvider for more groups and built them, up to -MaxQueueAhead, or every group when they had no jobs.
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.
Depends on #127, merge after it.
What was wrong
The dispatcher's group-fetch loop tested only the run's token, which
Test-PkAbortSignalcancels after that loop, not the abort flag thatRequest-PkAbortand Ctrl+C raise. So an abort raised by-GroupProvider,-JobBuilder,-GroupCompleteCallbackor-GroupReleaseCheckstill asked-GroupProviderfor more groups and built them, until-MaxQueueAheadwas full, or every group when the groups had no jobs. No program started from them (#121 checks per start), but a provider that takes work off a queue lost it, and-JobBuilderran for groups that never ran.What changed
The fetch loop checks the abort flag before each group, as #121 did for the start loop.
How it was tested
Four new assertions in harness section O: 10 groups,
-MaxQueueAhead 3, an abort from each of the four callbacks (the last two with groups that have no jobs); none may ask-GroupProvideragain after the abort, or build a group asked for after it.Before the fix (the branch's parent kit with the new harness), 5.1 and 7 alike:
After: the full harness passes on Windows PowerShell 5.1 and PowerShell 7 (803 assertions each).