Repository navigation
Read the answer, not a stray value, from -GroupReleaseCheck, -GroupProvider and -NextJobProvider - #62
Merged
Merged
Conversation
…ovider and -NextJobProvider A value a callback lets out before its answer (an ArrayList.Add index) arrives together with it: - -GroupReleaseCheck: `$log.Add($g); return $false` read as true and released a held group early. Only the last value counts now, as with -JobPollCompleted. - -GroupProvider: `$log.Add(...); return $null` arrived as @(index, $null), was taken as one more group, and the dispatcher asked again forever. Output ending in $null is now the end, with a warning. - -NextJobProvider: took the last hashtable and ignored a final $null, so a hashtable leaked before `return $null` ran as a job, and of two hashtables the first was dropped silently. The last value decides now, and anything else is warned about. README and help state each callback's return contract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A value a callback lets out before its answer (an
ArrayList.Addindex is the usual one) reaches the kit together with the answer, as one array. Three callbacks read the wrong thing from that array:-GroupReleaseCheckreleased a held group early.$log.Add($g); return $falsearrived as@(0, $false), which[bool]reads as true. It now takes the last value, as-JobPollCompletedalready does.-GroupProvidercould make a run that never ends.$log.Add('asked'); return $nullarrived as@(0, $null), which isn't$null, so the dispatcher took it as one more group and asked again, forever. Output that ends in$nullis now the end of the groups, with a warning.-NextJobProvidertook the wrong value from mixed output. It kept the last hashtable and ignored a final$null: a hashtable let out beforereturn $nullran as a job and the run didn't end, and of two hashtables the first was dropped silently. Now the last value decides:$nullends the run, otherwise the last hashtable is the job, and anything else is ignored with a warning.The README and help now state each callback's contract: one group or
$nullfrom-GroupProvider(return ,@('a', 'b', 'c')for a list as one group), one job or$nullfrom-NextJobProvider, and only the last value counting for-GroupReleaseCheck. The README's claim that callback output "can't corrupt the dispatcher's result by accident" is replaced by what actually happens to stray output.One consequence: a list given as one group can't end in
$null, wrapped or not.return ,@('a', $null)reaches the dispatcher exactly as$list.Add(...); return $nulldoes, so it's read as the end, with a warning. The README says so.Testing
-GroupReleaseCheckthat leaks a value, a-GroupProviderthat leaks one beforereturn $null, a wrapped list group, and-NextJobProvideroutputting two jobs, and a job then$null. The four bug tests failed on the old code (group released after 1 check of 3; the provider ran away and was cut off after 10 calls; no warnings, and the leaked job ran) and pass now.🤖 Generated with Claude Code