Repository navigation
fix(git): drain upload-pack output while writing negotiation - #72
rolandjitsu merged 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
+ Coverage 97.79% 98.38% +0.58%
==========================================
Files 9 9
Lines 4083 5079 +996
==========================================
+ Hits 3993 4997 +1004
+ Misses 90 82 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2a347e1 to
2fb38ef
Compare
|
The tests, lint, commit checks and both image builds pass. The remaining I checked the comparison: the base report is for 00b024b, using Rust 1.99.1; With the same Rust 1.94.1 toolchain and full test suite, unique LCOV source-line Could the main coverage report be regenerated with the current CI toolchain |
rolandjitsu
left a comment
There was a problem hiding this comment.
Thanks for the contribution! Mostly everything looks fine, just a couple of minor things.
Also, could you cleanup the commits?
Keep rolandjitsu#72, rolandjitsu#76 and rolandjitsu#77 with internal maintenance while deferring rolandjitsu#67. Preserve the previous tree on its archive branch and in normal history. Assisted-by: OpenAI:Codex
205fc39 to
469ae3e
Compare
|
Updated, and the history is cleaned up: 4 commits rebased on main (the toolchain pin and its revert are gone, since they cancelled out). While fixing the hang I also changed Each commit passes fmt, clippy and the tests on Linux. I could not run it on macOS, so it would be great if you could re-run the suite there. |
628b89b to
1d4460b
Compare
Write negotiation while streaming stdout to avoid pipe backpressure. Own the writer and child together through cancellation and cleanup. Assisted-by: Claude:claude-opus-4-8
Unlike std, tokio's output and spawn inherit stdin, so a child that reads it blocks on a terminal or an open pipe. Assisted-by: Claude:claude-opus-4-8
A child that exits before reading its input made the write fail with a broken pipe that hid the real failure. Report the exit status first. Assisted-by: Claude:claude-opus-4-8
1d4460b to
2ed4286
Compare
What kind of change does this PR introduce?
Summary
Large upload-pack negotiations can fill stdin and stdout at the same time,
leaving clone/fetch requests blocked. Write the request while streaming stdout,
and keep the writer and child under one owner through cancellation and cleanup.
Write and child-exit errors reach the response body, including after stdout EOF.
Request writing now has a five-minute deadline. Response reads reset a
30-minute inactivity deadline; active transfers have no total duration limit
after the request is written. These limits are documented.
Also: git subprocesses that never need input no longer inherit stdin (a
test hung on a terminal), and
prune_wantsreportsupdate-ref's exitstatus when it stops reading early.
Fixes #71.
Tests
A real Git request with 30,000 haves times out before the fix and returns the
exact expected response after it. Tests also cover small v0/v2 requests, pipe
errors, deadlines, cancellation, early leader exit, buffered output and process
group cleanup. HTTP tests exercise FIN and RST with a blocked stdin writer.
All 189 tests pass on Linux. Non-Linux runtime was not tested.
Checklist
and locked all-feature tests pass.
Breaking change?
No API or configuration changes. Requests exceeding the new write or inactivity
limits now fail. Failures after headers terminate the response body.