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

[PATCH] upload-pack: fix timeout in create_pack_file

From
MLMatthias Lederhofer <matled@gmx.net>
Date
Jul 18, 2006, 17:14 UTC
Message-ID
<E1G2t9n-0005PW-72@moooo.ath.cx>
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
---
<yacc> fatal: packfile '../linux-2.6/.git/objects/pack/tmp-7iPJo5'
       SHA1 mismatch
<yacc> error: git-fetch-pack: unable to read from git-index-pack
<yacc> error: git-index-pack died with error code 128
<yacc> Any idea what this means?
This happens after ~12 minutes.  The problem is that the loop in
upload-pack.c actually sending the pack does not reset the timeout.
I'd guess --timeout is 600 or a bit more on git.kernel.org :)

This does not help for low timeouts with slow clients. If a client is slow enough so the server is blocked for more time than specified by timeout the connection will be closed too (e.g. 15kb/s with a timeout of 30 (git adds 10 extra) is not enough). We should either add a warning to the man page or try to fix this. I don't know if this can be fixed not using non-blocking sockets.

Perhaps support for resume would be quite useful too but I've no idea how hard this is to implement.

A workaround for is to pull a part of the repository first and the
rest later.  For example using this:
$ git init-db
$ git fetch URL refs/tags/old-tag:refs/tags/old-tag
$ git fetch URL refs/tags/newer-tag:refs/tags/newer-tag
..
---
 upload-pack.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/upload-pack.c b/upload-pack.c
index f6f5a7e..07ecdb4 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -182,6 +182,8 @@ static void create_pack_file(void)
 		ssize_t sz;
 		int pe, pu, pollsize;
 
+		reset_timeout();
+
 		pollsize = 0;
 		pe = pu = -1;
 
-- 
1.4.2.rc1.ge7a0
Next: Junio C Hamano
Message 1 of 4 in “upload-pack: fix timeout in create_pack_file”
  1. upload-pack: fix timeout in create_pack_fileMatthias Lederhofer, Jul 18, 2006
  2. Junio C HamanoJul 24, 2006
  3. Matthias LederhoferJul 24, 2006
  4. Junio C HamanoJul 24, 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.