Add a maximum read buffer size to ExecFuture
Summary:
Ref T4241. Currently, ExecFuture may read an arbitrarily large amount of data into memory during execution. In T4241, this arises specifically with git-upload-pack, which emits about as much data as the size of the repository. Currently, the subprocess emits this data far faster than we can send it over the network, so we end up with a huge in-process buffer containing the entire repository.
Instead, we want to throttle git-upload-pack until the network can catch up. This is the first step in letting that happen.
Test Plan: Added a unit test.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T4241
Differential Revision: https://secure.phabricator.com/D7772