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

Re: [RFC PATCH] Add WEBDAV timeout to http-fetch.

From
Junio C Hamano <junkio@cox.net>
Date
Oct 7, 2006, 10:15 UTC
Message-ID
<7viriwsa75.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<BAYC1-PASMTP11CF83A008B0B3BA5F6B15AE100@CEZ.ICE>
Sean <seanlkml@sympatico.ca> writes:
Show 25 quoted lines
> If a server is having problems delivering the Git repo over WEBDAV,
> timeout after two minutes so that a regular http transfer can
> be tried.
>
> ---
>
>  http-fetch.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> Not sure if this is the correct fix, but it should improve the situation
> for cloning and fetching from servers like Takis's.  When connecting to
> his server WEBDAV doesn't respond after the initial connection.  Nothing
> proceeds until the OS connection times out many minutes later.
>
> This patch sets the CURL timeout to two minutes so that things proceed
> sooner.  Even with this patch it takes two extra minutes of "dead time"
> to complete all operations; obivously this still sucks.
>
> However, I don't know if the two minute timeout is long enough for
> all cases with a server where WEBDAV is functioning properly.
> Hopefully someone who knows more about Curl can comment and perhaps
> offer another solution.
>
> Maybe the real solution is just to figure out and fix whatever is
> going on with the WEBDAV server and forget this patch.

I think it is prudent to protect the client from a broken server and it is independent from "fixing" the server side. It would perhaps make sense to make this overridable somehow but I am not sure how -- .git/config is too global (the problem would be per remote site), and having the user to set environment variable only when going to specific server is too cumbersome to be useful. This ideally should be a per-remote configuration item.

Show 14 quoted lines
> diff --git a/http-fetch.c b/http-fetch.c
> index bc74f30..046245a 100644
> --- a/http-fetch.c
> +++ b/http-fetch.c
> @@ -861,6 +861,7 @@ static int remote_ls(struct alt_base *re
>  	curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 1);
>  	curl_easy_setopt(slot->curl, CURLOPT_CUSTOMREQUEST, DAV_PROPFIND);
>  	curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
> +	curl_easy_setopt(slot->curl, CURLOPT_TIMEOUT, 120);
>  
>  	if (start_active_slot(slot)) {
>  		run_active_slot(slot);
> -- 
> 1.4.2.3.gabd697
Previous: SeanNext: Jakub Narebski
Message 5 of 19 in “Problem cloning packed-and-pruned http repository”
  1. Panagiotis IssarisOct 6, 2006
  2. Panagiotis IssarisOct 6, 2006
  3. SeanOct 6, 2006
  4. Add WEBDAV timeout to http-fetch.Sean, Oct 7, 2006
  5. Junio C HamanoOct 7, 2006
  6. Jakub NarebskiOct 7, 2006
  7. Johannes SchindelinOct 7, 2006
  8. Petr BaudisOct 7, 2006
  9. Petr BaudisOct 7, 2006
  10. Johannes SchindelinOct 7, 2006
  11. Junio C HamanoOct 8, 2006
  12. Johannes SchindelinOct 8, 2006
  13. SeanOct 8, 2006
  14. Junio C HamanoOct 8, 2006
  15. Panagiotis IssarisOct 11, 2006
  16. Johannes SchindelinOct 11, 2006
  17. Panagiotis IssarisOct 7, 2006
  18. Junio C HamanoOct 7, 2006
  19. Panagiotis IssarisOct 7, 2006

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.