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

Re: [PATCH 07/11] Resumable clone: add resumable download to http/curl

From
KWKevin Wern <kevin.m.wern@gmail.com>
Date
Sep 28, 2016, 06:41 UTC
Message-ID
<20160928064156.GG3762@kwern-HP-Pavilion-dv5-Notebook-PC>
In-Reply-To
<xmqqfuozihuv.fsf@gitster.mtv.corp.google.com>
On Fri, Sep 16, 2016 at 03:45:44PM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> > @@ -1136,7 +1138,10 @@ static int handle_curl_result(struct slot_results *results)
> >  				curl_easy_strerror(results->curl_result),
> >  				sizeof(curl_errorstr));
> >  #endif
> > -		return HTTP_ERROR;
> > +		if (results->http_code >= 400)
> > +			return HTTP_ERROR;
> > +		else
> > +			return HTTP_ERROR_RESUMABLE;
> >  	}
> >  }
> 
> Hmm, is "anything below 400" a good definition of resumable errors?

Definitely a rough definition, but I think it covers the majority of cases. I based this on the fact that my example resumable errors (disconnections during download) either had results->http_code set to 206 or 0, and that http errors generally indicate some underlying issue that can't be solved with a repeat request (there are plenty of exceptions, such as 503 or 504 errors that happen intermittently). I thought that was enough to be a placeholder in the model. I did consider something like "has (the file changed size or http_code been 206, some indication of success happened) in the last [x] attempts," but I question the precision of something like that, especially before exploring other tried-and-true solutions.

This patch is definitely the sketchiest part of my series, IMO. The concept isn't fleshed out enough, even theoretically--containing only the element of retrying with some very basic components to those decisions. I think that this will ultimately require fishing through other examples of resumable downloads (which was very painful to read when I tried). I know curl has a --retry option, but doesn't include it in libcurl...harumph. I'll probably try to read that implementation and chromium's resumable download code again.

I'll get back to you with a better plan here once I read through a few examples.

- Kevin
Previous: Junio C HamanoNext: Kevin Wern
Message 18 of 39 in “Resumable clone”
  1. 00/11 Resumable cloneKevin Wern, Sep 16, 2016
  2. 01/11 Resumable clone: create service git-prime-cloneKevin Wern, Sep 16, 2016
  3. Junio C HamanoSep 16, 2016
  4. Kevin WernSep 28, 2016
  5. 02/11 Resumable clone: add prime-clone endpointsKevin Wern, Sep 16, 2016
  6. Duy NguyenSep 19, 2016
  7. Kevin WernSep 28, 2016
  8. 03/11 pkt-line: create gentle packet_read_line functionsKevin Wern, Sep 16, 2016
  9. Junio C HamanoSep 16, 2016
  10. Kevin WernSep 28, 2016
  11. 04/11 Resumable clone: add prime-clone to remote-curlKevin Wern, Sep 16, 2016
  12. Duy NguyenSep 19, 2016
  13. Kevin WernSep 28, 2016
  14. 05/11 Resumable clone: add output parsing to connect.cKevin Wern, Sep 16, 2016
  15. 06/11 Resumable clone: implement transport_prime_cloneKevin Wern, Sep 16, 2016
  16. 07/11 Resumable clone: add resumable download to http/curlKevin Wern, Sep 16, 2016
  17. Junio C HamanoSep 16, 2016
  18. Kevin WernSep 28, 2016
  19. 08/11 Resumable clone: create transport_download_primerKevin Wern, Sep 16, 2016
  20. 10/11 run command: add RUN_COMMAND_NO_STDOUTKevin Wern, Sep 16, 2016
  21. Junio C HamanoSep 16, 2016
  22. Johannes SchindelinSep 18, 2016
  23. Kevin WernSep 28, 2016
  24. Junio C HamanoSep 28, 2016
  25. Kevin WernSep 28, 2016
  26. 09/11 path: add resumable markerKevin Wern, Sep 16, 2016
  27. Duy NguyenSep 19, 2016
  28. 11/11 Resumable clone: implement primer logic in git-cloneKevin Wern, Sep 16, 2016
  29. Junio C HamanoSep 16, 2016
  30. Kevin WernSep 28, 2016
  31. Duy NguyenSep 19, 2016
  32. Junio C HamanoSep 19, 2016
  33. Kevin WernSep 28, 2016
  34. Junio C HamanoSep 16, 2016
  35. Eric WongSep 27, 2016
  36. Junio C HamanoSep 27, 2016
  37. Junio C HamanoSep 28, 2016
  38. Junio C HamanoSep 28, 2016
  39. Eric WongSep 28, 2016

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.