Skip to content

Use Windows Job Objects in the shared Git blob reader - #5721

Draft
josecarlosgonzalezroque-design wants to merge 1 commit into
CrocSwap:mainfrom
josecarlosgonzalezroque-design:fix/windows-git-reader-ownership
Draft

josecarlosgonzalezroque-design wants to merge 1 commit into
CrocSwap:mainfrom
josecarlosgonzalezroque-design:fix/windows-git-reader-ownership

Conversation

@josecarlosgonzalezroque-design

Copy link
Copy Markdown
Contributor

Change and mathematical scope

On Windows, a Git descendant retaining a pipe could survive the leader and keep the shared blob reader blocked after its direct-child timeout. The reader now adopts the gated Job Object owner and separate launch-status channel from #5463 and #5524 at one process factory. It stops the owned job before closing buffered pipes on success, response timeout, early generator close and consumer failure, while preserving native launch exceptions and the existing exit-129 compatibility retry.

This is tooling only. Protocol fixtures retain a dedicated launch seam; real-Git/native fixtures exercise the actual owner. Standalone consumer fixtures include the companion module, and helper-only changes trigger shared replay selection. Two fixture portability fixes preserve their existing predicates: literal LF in Git alternates and an index-only symlink-mode entry.

Task and overlap

The integration note records exact sources, contract, task boundaries, commands, result counts and limitations.

Validation

Native Windows 11 build 26300, CPython 3.12.10, Git 2.53.0.windows.3:

python -W error -B -m unittest discover -s tests -p 'test_research_git_*.py' -v
python -W error -O -B tests/test_research_git_windows.py -v

The first command passes 67 tests with 8 platform skips; all 5 native tests pass under optimized Python as well. Retained process handles observe descendant exit before teardown. Replacing ownership with direct Popen must produce six failures and no fixture errors. Native launch errors retain their type and five fields; only a launched exit 129 retries and returns exact binary blobs.

The documented export, source-history, commit-byte, scaffold, planning, onboarding, diagnostic, path and source-role suites also pass. The scaffold retains two metadata calls plus one blob stream and exact generated pins. git diff --check passes. The published tree 1340bd2b4a61f59e5afcd27d3419efce3e972f68 matches the tested local tree.

POSIX tests were not executed on this host. Unsupported filename/symlink cases skip. No cold mathematical replay or timing benchmark was run, and no selected-frontier change is proposed.

Credit

Mihir Srivastava (#5463/#5524), ywz65 (gated Job Objects and retained-handle observer), Brian / JoyboyBrian (deadlines and POSIX lifetime), Nick Petalas (blob/fallback reader), Douglas Colkitt (runner), and the retained source/fixture lineage. Frozen packages and their notices are unchanged. Apache-2.0; prepared for josecarlosgonzalezroque-design with substantial OpenAI Codex assistance, one agent. Evidence is author-checked.

Open next questions

Draft for substantive adapter review and a POSIX consumer run. Repeat the native suite on another Windows/Python version and under restrictive enclosing jobs. Hard owner death during setup and abrupt parent termination are not newly certified. The helper supports the reader's binary, string-argv, context-managed subset rather than general Popen options.

Integrate the gated Job Object owner and launch diagnostics from PR5463 and
PR5524. Exercise the shared factory, preserve protocol fixtures and include
the companion module in standalone consumer fixtures.

Prepared with substantial OpenAI Codex assistance. Predecessor attribution
and native validation scope are recorded in the integration note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant