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

[PATCH] git-upload-pack: make sure we close unused pipe ends

From
HAH. Peter Anvin <hpa@zytor.com>
Date
Mar 27, 2007, 23:45 UTC
Message-ID
<200703272347.l2RNln90025931@tazenda.hos.anvin.org>

Right now, we don't close the read end of the pipe when git-upload-pack runs git-pack-object, so we hang forever (why don't we get SIGALRM?) instead of dying with SIGPIPE if the latter dies, which seems to be the norm if the client disconnects.

Thanks to Johannes Schindelin <Johannes.Schindelin@gmx.de> for pointing out where this close() needed to go.

This patch has been tested on kernel.org for several weeks and appear to resolve the problem of git-upload-pack processes hanging around forever.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
 upload-pack.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/upload-pack.c b/upload-pack.c
index 498bf50..d3a09e7 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -119,6 +119,7 @@ static void create_pack_file(void)
 		int i;
 		struct rev_info revs;
 
+		close(lp_pipe[0]);
 		pack_pipe = fdopen(lp_pipe[1], "w");
 
 		if (create_full_pack)
-- 
1.5.0.3
Message 1 of 1 in “git-upload-pack: make sure we close unused pipe ends”
  1. git-upload-pack: make sure we close unused pipe endsH. Peter Anvin, Mar 27, 2007

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.