]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
git: use Unix stream sockets for `cat-file --batch-*'
authorEric Wong <e@80x24.org>
Sat, 30 Sep 2023 15:20:39 +0000 (15:20 +0000)
committerEric Wong <e@80x24.org>
Sun, 1 Oct 2023 07:05:23 +0000 (07:05 +0000)
commit9b068be88b252355c1c62f804d4f081e9a20570d
tree4cf3ab9eebd8361bd9a3857c4d307783997be63c
parentbf929e8ddfb9359a97cd8be3d3017c038564d52d
git: use Unix stream sockets for `cat-file --batch-*'

The benefit of 1MB potential pipe buffer size (on Linux) doesn't
seem noticeable when reading from git (unlike when writing to v2
shards), so Unix stream sockets seem fine, here.

This allows us to simplify our process management by using the
same socket FD for reads and writes and enables us to use our
ProcessPipe class for reaping (as we can do with Gcf2Client).

Gcf2Client no longer relies on PublicInbox::DS for write
buffering, and instead just waits for requests to complete
once the number of inflight requests hits the MAX_INFLIGHT
threshold as we do with PublicInbox::Git.

We reuse the existing MAX_INFLIGHT limit (18) that was
determined by the minimum allowed PIPE_BUF (512).  (AFAIK) Unix
stream sockets have no analogy to PIPE_BUF, but all *BSDs and
Linux I've checked have default SO_RCVBUF and SO_SNDBUF values
larger than the previously-required PIPE_BUF size of 512 bytes.
lib/PublicInbox/Gcf2Client.pm
lib/PublicInbox/Git.pm
lib/PublicInbox/GitAsyncCat.pm
lib/PublicInbox/LeiToMail.pm
lib/PublicInbox/ViewVCS.pm