Skip to content

upload-pack: send keepalive while feeding pack-objects#2160

Open
spkrka wants to merge 1 commit into
gitgitgadget:masterfrom
spkrka:apache-timeout
Open

upload-pack: send keepalive while feeding pack-objects#2160
spkrka wants to merge 1 commit into
gitgitgadget:masterfrom
spkrka:apache-timeout

Conversation

@spkrka

@spkrka spkrka commented Jun 27, 2026

Copy link
Copy Markdown

When upload-pack feeds revision OIDs to pack-objects via pipe, there is a gap where no data is sent to the HTTP client. With many wants (e.g. 50k+ refs), this pipe feeding can take seconds as write() blocks on the pipe when the kernel buffer fills up. Meanwhile, an HTTP server sitting in front of git (e.g. Apache) may time out waiting for CGI output and kill the process.

The existing keepalive mechanism in create_pack_file's poll loop handles keepalive after pack-objects starts producing output, but does not cover the earlier pipe feeding phase.

This extends keepalive coverage by sending empty sideband packets during the pipe feeding loops, using the same 0005\1 format that the poll loop already uses. This reuses the existing uploadpack.keepalive config with no new options required.

cc: Jeff King peff@peff.net
cc: Patrick Steinhardt ps@pks.im

When upload-pack feeds revision OIDs to pack-objects via pipe, there
is a gap where no data is sent to the HTTP client. With many wants
(e.g. 50k+ refs), this pipe feeding can take seconds as write()
blocks on the pipe when the kernel buffer fills up. Meanwhile, an
HTTP server sitting in front of git (e.g. Apache) may time out
waiting for CGI output and kill the process.

The existing keepalive mechanism in create_pack_file's poll loop
handles keepalive after pack-objects starts producing output, but
does not cover the earlier pipe feeding phase.

Extend keepalive coverage by sending empty sideband packets during
the pipe feeding loops, using the same "0005\1" format that the poll
loop already uses. This reuses the existing uploadpack.keepalive
config with no new options required.

Signed-off-by: Kristofer Karlsson <krka@spotify.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant