fix: jobs-v2 program runs can leave background children running after a successful command exits#879
Closed
sam-saffron-jarvis wants to merge 1 commit into
Closed
Conversation
… a successful command exits
Owner
|
Closing after manually bringing the validated changes into the working copy. |
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 changed
programruns now use the same process cleanup helper as the shell tool, so cleanup always best-effort kills the command process group and nonce-tagged descendants after the command returns.WaitDelayafter installing the shared cleanup helper, preserving the runner's prior wait-delay behavior.Runreturns.Why this is high-value
Jobs-v2 is a daily automation path for Jarvis. Before this change, a successful
programcommand could launch a background child and exit cleanly, causing Jarvis to mark the job successful while the child kept running indefinitely. Repeated scheduled runs could accumulate orphaned CPU/memory/file-handle consumers and make later operations harder to reason about.Validation
sleepprocess remained alive afterRunreturned.gofmt -w cmd/serve_jobs_v2.go cmd/serve_jobs_v2_program_test.gogo build ./...go test ./...go test ./cmd -run TestJobsV2ProgramRunner_CleansUpBackgroundChildOnSuccess -count=5git diff --check