git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] http-backend: write error packet if backend command fails

From
Jeff King <peff@peff.net>
Date
Mar 28, 2020, 15:13 UTC
Message-ID
<20200328151300.GA1215566@coredump.intra.peff.net>
In-Reply-To
<20200328145741.GA1209174@coredump.intra.peff.net>
On Sat, Mar 28, 2020 at 10:57:42AM -0400, Jeff King wrote:
> But since it works for v1 (which also dies!), and since you were able to
> reproduce the problem locally, I suspect it may be an issue in
> upload-pack itself.
Actually, I think the problem is on the client side.

If I run your test without the http-backend change, then nothing is left running on the server side, but on the client we have two processes: git-clone and the git-remote-https helper. And they're deadlocked trying to read from each other.

I think the issue is that git-remote-https in v2 mode calls into stateless_connect(), and just pumps http request/response pairs from git-clone to the server. But if a request generates an empty response, then clone has no idea that anything was received at all. It continues waiting, but remote-https has looped to expect another request from it.

Your patch fixes _this case_ because it causes the server to send a non-empty response. But the client can't rely on that. Besides that not being a documented server behavior, in the worst case the connection could be severed mid-stream. So I think remote-https needs to complain about an empty response. This isn't a problem in v1 because it would actually try to look at that empty response; in v2 it's just proxying bytes around.

-Peff
Previous: Jeff KingNext: Jeff King
Message 3 of 5 in “http-backend: write error packet if backend command fails”
  1. http-backend: write error packet if backend command failsDenton Liu, Mar 28, 2020
  2. Jeff KingMar 28, 2020
  3. Jeff KingMar 28, 2020
  4. Jeff KingMar 28, 2020
  5. Denton LiuMar 29, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.