- Ran `git clone ...` against a large repository (Phabricator) in a loop for a long time.
- Before the patch, it would very occasionally hang randomly, on the "Receiving objects: ..." step (on my local install, I could get this maybe 2-3% of the time?)
- After the patch, I can't get it to hang anymore and have been running it for ~10x longer than it ever needed before.
Beyond this, I added a bunch of debugging/logging which seemed to confirm that my analysis/fix are correct. Specifically:
- I added a log when we were tearing down the process to see if either stdout or stderr were not `feof()`'d. When things hung, this message logged; normally, it did not.
- I added logging to show the final bytes read from the subprocess and the final bytes sent to the client. The correct final bytes look something like `...\002Total 190735 (delta 132738), reused 186896 (delta 129329)\n0000`. When the error occurred, different final bytes were observed.