[APP-3185] Kill generator process groups on cancellation - #14853
Draft
kevinyang372 wants to merge 2 commits into
Draft
[APP-3185] Kill generator process groups on cancellation#14853kevinyang372 wants to merge 2 commits into
kevinyang372 wants to merge 2 commits into
Conversation
Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
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.
Description
Fixes per-command cancellation for local generator commands so Warp terminates the entire process group rather than only the immediate shell or wrapper process.
This addresses an enterprise failure mode where a Git wrapper is killed with
SIGKILL, its real Git child survives, and periodic prompt refreshes accumulate orphaned Git processes. Each generator already starts in a dedicated Unix process group; this change adds scoped ownership that removes PID bookkeeping and kills that group whenever the command future is dropped or errors. Normal completion disarms cleanup, while bulk session cancellation reuses the same group-termination path.A real-process regression test starts a shell descendant behind a FIFO and verifies dropping the command future terminates the descendant before it can perform a side effect. A second test verifies normal completion removes the command from later bulk cancellation.
Linked Issue
ready-to-specorready-to-implement. (N/A: internal Linear follow-up)Testing
cargo nextest run -p warp 'local_command_executor::tests::unix'— 2 passed after merging currentorigin/masterExact three Clippy commands from
script/presubmit— passed after merging currentorigin/master./script/format --check— passed after merging currentorigin/masterFull
./script/presubmit— passed before the non-overlappingorigin/mastermerge (10,872 workspace tests plus completer-v2 and doc tests)Local platform: macOS
Linux cloud verification was not run because
oz-devis unavailable in the submitting environment; the new implementation and tests are Unix-gatedI have manually tested my changes locally with
./script/run(N/A: no interactive UI behavior)Agent Mode
Agent artifacts
CHANGELOG-BUG-FIX: Fixed canceled background commands leaving wrapped child processes running.
Co-Authored-By: Warp agent@warp.dev