Repository navigation
Add -StreamTimeoutMs to Invoke-PkProcessBatch and Invoke-PkProcessDispatch - #74
Merged
Merged
Conversation
…patch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the shared default 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.
What was wrong
How long the batch and the dispatcher wait for a program's output after it exits, when something it started holds the output open, was fixed at 15 seconds. The batch never had a way to change it. Since #71 moved that wait into the dispatcher's default
-JobPollCompleted, a-JobFinalizethat passed a shorter-StreamTimeoutMstoComplete-PkProcessno longer shortened it: the job held its slot for the full 15 seconds first.What changed
Invoke-PkProcessBatchandInvoke-PkProcessDispatchtake-StreamTimeoutMs(default 15000, 0 or more, a negative value refused before anything starts). The default poll gives up on held output after it, and the batch passes it to the dispatcher.OutputWaitMs, a new reserved job key, when its wait starts.Complete-PkProcesswith no-StreamTimeoutMsof its own uses that instead of 15000, so it doesn't wait a second time. One given its own still waits only the rest, as before.OutputWaitMsis only read together with the poll'sOutputWaitstopwatch, so a field of that name on a job the dispatcher never waited on is ignored..GetNewClosure()block now, to carry the limit. Measured on stub jobs with 20,000 jobs, it's no slower: 5.0-5.5 s on 5.1 against 5.0-6.1 s before, and about 2.6 s on 7 either way.-JobFinalizenote.How it was tested
Complete-PkProcess: 1.0-1.1 s.-StreamTimeoutMs 3000in finalize: 3.0-3.1 s.🤖 Generated with Claude Code