Skip to content

Fix stalled HTTP fetches with large payloads

Stan Hu requested to merge sh-fix-git-large-upload-pack into master

For fetches over HTTP, Workhorse executes git-upload-pack and first attempts to send all the input data to stdin before reading from the stdout pipe. However, when the payload is large, the stdout pipe may fill up, causing git-upload-pack to stop reading from stdin. Workhorse will then be deadlocked, since it will be waiting to send more data to a buffer that will never be drained.

An addition side effect is that git-upload-pack processes also get left around. These processes are cleaned up only after Workhorse is restarted.

This fix modifies the git-upload-pack behavior to consume the entire HTTP input first so that reading the data from stdout and sending the reply can be performed in a separate Goroutine.

Closes #92 (closed)

Closes gitlab-org/gitlab-ce#25916

Closes gitlab-com/infrastructure#941 (closed)

Merge request reports