Skip to content

fix(gitcmd): stop windows git helpers without taskkill - #313

Merged
cpcloud merged 3 commits into
mainfrom
fix/git-windows-cancel-tree
Nov 5, 2026
Merged

cpcloud merged 3 commits into
mainfrom
fix/git-windows-cancel-tree

Conversation

@rodboev

@rodboev rodboev commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Windows callers can cancel Git network operations without leaving HTTP helpers connected, fixing the cancellation failure in run 101.

Terminate descendants through Windows process APIs so taskkill's one-second timeout cannot fall back to killing only Git. Keep the existing cancellation and pipe-drain deadlines.

Git cancellation must stop HTTP helpers as well as their parent. The
one-second taskkill budget could expire before tree termination, after which
the fallback killed only Git and left helpers connected.
@rodboev rodboev added the autopr Used for a PR created by an automated system label Nov 5, 2026
@roborev-ci

roborev-ci Bot commented Nov 5, 2026

Copy link
Copy Markdown

roborev: Combined Review (a8cabeb)

Verdict: Changes require fixes for 2 findings.

High

  • git/cmd/gitcmd_windows.go:44: The creation-time cutoff is recorded after the process snapshot. A snapshotted child can exit and its PID can be reused before the cutoff is recorded, allowing an unrelated replacement process to pass the timestamp checks and be terminated.

    Fix: Record the creation-time cutoff before creating the process snapshot, or independently verify the opened process's identity and parentage before terminating it.

Medium

  • git/cmd/gitcmd_windows.go:72: If an intermediate helper exits after the snapshot and cannot be opened, the early return skips its entire captured subtree. Live grandchildren can survive cancellation, retaining connections or inherited pipes and continuing work.

    Fix: Continue traversing snapshotted descendants when an intermediate process has exited, while preserving identity checks before terminating each live process. Add a regression test for an intermediate helper exiting while its descendant remains alive.


Reviewers: 3x codex, codex (security), codex (test-value) | Synthesis: codex, 10s | Total: 6m6s

A process snapshot must still identify a helper after it exits. Otherwise a
vanished intermediate can hide live descendants, and a reused PID can select
an unrelated process during cancellation.
@roborev-ci

roborev-ci Bot commented Nov 5, 2026

Copy link
Copy Markdown

roborev: Combined Review (ac7ef27)

Verdict: No findings at or above medium severity.


Reviewers: 3x codex, codex (security), codex (test-value) | Synthesis: codex | Total: 3m57s

The Windows cancellation test failed on every run because it expected the
shell to be Git's only child. Git starts without a console window, so
Windows gives it a new hidden console. The host process for that console
is also a child of Git.

The test now skips the console host and still requires exactly one other
child. A failure lists the image names of Git's children, so an
unexpected process tree is easy to diagnose.

Generated with Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roborev-ci

roborev-ci Bot commented Nov 5, 2026

Copy link
Copy Markdown

roborev: Combined Review (3db9811)

Verdict: No findings at or above medium severity.


Reviewers: 3x codex, codex (security), codex (test-value) | Synthesis: codex | Total: 3m6s

@cpcloud
cpcloud merged commit 65da48a into main Nov 5, 2026
15 checks passed
@cpcloud
cpcloud deleted the fix/git-windows-cancel-tree branch November 5, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autopr Used for a PR created by an automated system

Development

Successfully merging this pull request may close these issues.

2 participants