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

Re: [PATCH] fetch-pack: don't resend known-common refs in find_common

From
Dennis Kaarsemaker <dennis@kaarsemaker.net>
Date
Oct 22, 2014, 07:41 UTC
Message-ID
<1413963706.11656.5.camel@seahawk>
In-Reply-To
<xmqqd29l1f3p.fsf@gitster.dls.corp.google.com>
On di, 2014-10-21 at 10:56 -0700, Junio C Hamano wrote:
Show 16 quoted lines
> Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:
> 
> > By not clearing the request buffer in stateless-rpc mode, fetch-pack
> > would keep sending already known-common commits, leading to ever bigger
> > http requests, eventually getting too large for git-http-backend to
> > handle properly without filling up the pipe buffer in inflate_request.
> > ---
> > I'm still not quite sure whether this is the right thing to do, but make
> > test still passes :) The new testcase demonstrates the problem, when
> > running t5551 with EXPENSIVE, this test will hang without the patch to
> > fetch-pack.c and succeed otherwise.
> 
> IIUC, because "stateless" is just that, i.e. the server-end does not
> keep track of what is already known, not telling what is known to be
> common in each request would fundamentally break the protocol.  Am I
> mistaken?

That sounds plausible, but why then does the fetch complete with this line removed, and why does 'make test' still pass? I tried to understand the protocol, but the documentation has TODO's in some critical places :)

And if that's true, it means the inflate_request / upload-pack interaction should be fixed, so more than 64k (current linux pipe buffer size) of uncompressed data is supported. I see two options:

* Turning that interaction into a more cooperative process, with a
  select/poll loop
* Make upload-pack buffer its entire response when run in stateless_rpc
  mode until it has consumed all of the request

The latter sounds easier to do, but not being very familiar with the protocol, I may have missed something obvious.

-- 
Dennis Kaarsemaker
http://www.kaarsemaker.net
Previous: Junio C HamanoNext: Duy Nguyen
Message 5 of 10 in “git fetch (http) hanging/failing on one specific repository, http only”
  1. Dennis KaarsemakerOct 20, 2014
  2. Bug in fetch-pack causing ever-growing http requests. (Was: git fetch (http) hanging/failing on one specific repository, http only)Dennis Kaarsemaker, Oct 21, 2014
  3. fetch-pack: don't resend known-common refs in find_commonDennis Kaarsemaker, Oct 21, 2014
  4. Junio C HamanoOct 21, 2014
  5. Dennis KaarsemakerOct 22, 2014
  6. Duy NguyenOct 22, 2014
  7. Dennis KaarsemakerOct 26, 2014
  8. Junio C HamanoOct 22, 2014
  9. Dennis KaarsemakerOct 26, 2014
  10. Shawn PearceDec 6, 2014

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.