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

Re: [PATCH 14/14] clone: give advice on how to resume a failed clone

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 10, 2011, 21:21 UTC
Message-ID
<7vvcqrsmfx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20111110075654.GN27950@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> We could make "git clone ..." automatically resume, but I'm a little
> nervous about that. I wrote a patch that did so, and it did work, but
> there are a lot of little hiccups as we violate the assumption that the
> directory didn't already exist (e.g., it writes multiple fetch refspec
> lines to the config).
Sorry, but I do not think the worry is quite justified.

The "assumption that directory didn't already exist" becomes an issue only if you implement your "git clone" that automatically resumes as a thin wrapper around the current "git clone" in the form of

    until git clone ...
    do
	echo retrying...
    done

Stepping back a bit, I think there are two different situations where resumable clone is beneficial. The "git clone" process died either by the machine crashing or the user hitting a \C-c, or the connection between the server and the "git clone" got severed for some reason.

Right now, the "got disconnected" case results in "git clone" voluntarily dying and as the result of this, the symptom appears the same. But it does not have to be that way. If we know the underlying transport is resumable, e.g. when you are fetching a prepared bundle over the wire.

I have this suspicion that in practice the "got disconnected" case is the majority. If "git clone" does not die upon disconnect while fetching a bundle, but instead the fetching of the bundle is resumed internally by reconnecting to the server and requesting a range transfer, there is no risk of "writes multiple fetch refspec lines" etc, no?

Of course, it is _also_ beneficial if we made "git clone" resumable after you purposefully kill it (maybe you thought it will clone within minutes, but it turns out that it may take hours and you have to turn off the machine in the next five minutes before leaving the work, or something). A solution for that case _could_ be used for the "got disconnected" case by letting it voluntarily die as we currently do, but I do not think that is an optimal solution to the "got disconnected" case.

Previous: Jeff KingNext: Jeff King
Message 19 of 23 in “resumable network bundles”
  1. 0/14 resumable network bundlesJeff King, Nov 10, 2011
  2. Jeff KingNov 10, 2011
  3. 01/14 t/lib-httpd: check for NO_CURLJeff King, Nov 10, 2011
  4. 02/14 http: turn off curl signalsJeff King, Nov 10, 2011
  5. Daniel StenbergNov 10, 2011
  6. Jeff KingNov 11, 2011
  7. 03/14 http: refactor http_request functionJeff King, Nov 10, 2011
  8. 04/14 http: add a public function for arbitrary-callback requestJeff King, Nov 10, 2011
  9. 05/14 remote-curl: use http callback for requesting refsJeff King, Nov 10, 2011
  10. 06/14 transport: factor out bundle to ref list conversionJeff King, Nov 10, 2011
  11. 07/14 bundle: add is_bundle_buf helperJeff King, Nov 10, 2011
  12. 08/14 remote-curl: free "discovery" objectJeff King, Nov 10, 2011
  13. 09/14 remote-curl: auto-detect bundles when fetching refsJeff King, Nov 10, 2011
  14. 10/14 remote-curl: try base $URL after $URL/info/refsJeff King, Nov 10, 2011
  15. 11/14 progress: allow pure-throughput progress metersJeff King, Nov 10, 2011
  16. 12/14 remote-curl: show progress for bundle downloadsJeff King, Nov 10, 2011
  17. 13/14 remote-curl: resume interrupted bundle transfersJeff King, Nov 10, 2011
  18. 14/14 clone: give advice on how to resume a failed cloneJeff King, Nov 10, 2011
  19. Junio C HamanoNov 10, 2011
  20. Jeff KingNov 11, 2011
  21. David Michael BarrNov 11, 2011
  22. Tay Ray ChuanNov 12, 2011
  23. Jeff KingNov 12, 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.