Ref T9724. This is likely a fix for that issue, which could cause hangs on git clone and similar requests.
It appears that we were sometimes leaving data on the subprocess pipes. Specifically, here's what would happen:
- we'd have full or nearly-full read buffers on the ExecFuture;
- we'd update the subprocess;
- it would read only some of the data, but not be able to read everything (since the buffers were full, or became full after reading a little bit);
- however, since the subprocess had exited, we'd terminate the subprocess and close everything down.
In this situation, we would never read the final bytes off stdout or stderr.
This could lead to git clone correctly hanging, waiting for those last few bytes, which would never come.