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

Re: [RFC] helping smart-http/stateless-rpc fetch race

From
Shawn Pearce <spearce@spearce.org>
Date
Aug 6, 2011, 21:05 UTC
Message-ID
<CAJo=hJvdMCyU-5wzy0p1r+QJxXU=DJTE+Mu5G6pk9iAwAD51mA@mail.gmail.com>
In-Reply-To
<7vbow337gx.fsf@alter.siamese.dyndns.org>
On Fri, Aug 5, 2011 at 13:54, Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> A request to fetch from a client over smart HTTP protocol is served in
> multiple steps. In the first round, the server side shows the set of refs
> it has and their values, and the client picks from them and sends "I want
> to fetch the history leading to these commits".
>
> When the server tries to respond to this second request, its refs may have
> progressed by a push from elsewhere. By design, we do not allow fetching
> objects that are not at the tip of an advertised ref, and the server
> rejects such a request. The client needs to try again, which is not ideal
> especially for a busy server.
>
> Teach --allow-non-tip option to upload-pack (which is the workhorse driven
> by git-daemon and smart http server interface) that lets it server commits
> that are not at the tip of any advertised ref, as long as they are
> reachable from advertised refs.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>
>  * I'll leave it to interested parties who are more qualified than I am to
>   update remote-curl nor http-backend to actually ask upload-pack to use
>   this new logic ;-)

Why a new --allow-non-tip flag? Why not always do this with the existing --stateless-rpc flag? I think the only time it is reasonable to allow a non-tip want line is during the smart HTTP usage where the request has spanned processes and the references may have moved in the interm. Over a git:// or SSH where its the same server process and the refs were cached at startup (and thus cannot move), it isn't reasonable to allow a non-tip want.

Otherwise the patch looks good to me. This should fix some issues with very busy repositories being fetched over smart HTTP.

-- 
Shawn.
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 10 in “[RFC] helping smart-http/stateless-rpc fetch race”
  1. Junio C HamanoAug 5, 2011
  2. Shawn PearceAug 6, 2011
  3. Junio C HamanoAug 8, 2011
  4. Junio C HamanoAug 8, 2011
  5. Sverre RabbelierAug 8, 2011
  6. Ilari LiusvaaraAug 8, 2011
  7. Junio C HamanoAug 8, 2011
  8. Junio C HamanoAug 8, 2011
  9. Shawn PearceAug 8, 2011
  10. Junio C HamanoAug 8, 2011

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.