Skip to content

Bound direct Git blob response reads - #4738

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
JoyboyBrian:brian/git-blob-read-deadline
Oct 22, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
JoyboyBrian:brian/git-blob-read-deadline

Conversation

@JoyboyBrian

Copy link
Copy Markdown
Contributor

Git source-pin validation can block indefinitely in a batch response even though the reader has a process-exit timeout. This change bounds each direct-child request/header/payload/terminator exchange to 90 seconds and cancels/joins its watchdog before yielding, so consumer pauses do not consume the deadline. Expiry kills and reaps the direct child and raises TimeoutExpired; exact bytes, one-blob streaming, the one-shot unsupported-NUL fallback and normal protocol errors remain unchanged.

Validation on macOS 27 arm64, Python 3.12.2 / Git 2.44.0:

  • The unchanged main reader fails all three real-subprocess stall controls (header, partial payload, absent terminator); only the test's independent safety kill releases those reads. The repaired reader times out and reaps the child at each boundary. Readiness markers establish that each fixture reached its intended phase.
  • All 37 focused Git tests pass normally and under -O, including blocked writes, legacy payload stalls, delayed exact binary replies, consumer suspension, 128 real-Git blobs with no watchdog thread at any yield, existing fallback/rejection/early-close and replacement/path controls.
  • No selected construction replay, broad historical suite, native Windows or hosted CI result is claimed.

Only the shared reader, one test module and a scoped evidence note change. The separate git() helper, legacy git_source_rows, descendant-held pipes/promisor helpers and complete process-tree containment remain outside this bound. A valid but unusually slow complete blob response can exceed the 90-second total limit.

Canonical claim and scope. This complements #4686 at de93ebd044d0b00a8647a9f47f86939a6b18b9aa, which fixes Windows closed-stdin errors. Both touch adjacent lines of _git_blob_batch; the existing Windows repair is not reproduced here, and integration must retain both contracts.

Credit Nick Petalas, Arham Tahir, Woklerx, Mihir Srivastava and Douglas Colkitt for the retained reader, compatibility and package work. Prepared for Brian (JoyboyBrian) with substantial OpenAI Codex assistance and separate agent review; Apache-2.0. No new κ or selected-frontier change.

Pre-submission overlap recheck at 2026-10-22 18:39 UTC used the refreshed complete cache: 499 open PRs (18:35:14 UTC), 3,648 Discussion records (18:36:07 UTC), and all 5,860 local notes. No additional competing deadline scope was found beyond this claim and the retained compatibility work; closed PR diffs and unpublished work remain outside coverage. A live read confirms #4686 remains open at the exact head cited above. Canonical main remains b58ad9ef4d4e861b0eaa5dba41742bdc072dca51, priority revision 7.

@Mister-Meeseeks
Mister-Meeseeks merged commit f8de75f into CrocSwap:main Oct 22, 2026
200 of 257 checks passed
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.

2 participants