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

Re: Bug report: orphaned pack-objects after killing upload-pack on [

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 25, 2020, 21:42 UTC
Message-ID
<xmqqy2ipcdvj.fsf@gitster.c.googlers.com>
In-Reply-To
<X7zOKbzR9gwJHMbJ@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> So I think it is still a good idea to do, and what I wrote earlier is
> as good a we can do.
>
> René, do you want to wrap up your similar patch for the fetch side?

In the meantime, I may queue this on 'seen' but it cannot move forward without a signoff.

Thanks.
--- >8 ------ >8 ------ >8 ------ >8 ------ >8 ---
From: René Scharfe <l.s.r@web.de>
Date: Fri, 20 Nov 2020 19:52:45 +0100
Subject: [PATCH] upload-pack: kill pack-objects helper on signal or exit
We spawn an external pack-objects process to actually send objects
to the remote side. If we are killed by a signal during this
process, the pack-objects will hang around as a zombie.  We should
take it down when we go down.
---
 upload-pack.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/upload-pack.c b/upload-pack.c
index 3b858eb457..d4f7192d04 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -321,6 +321,7 @@ static void create_pack_file(struct upload_pack_data *pack_data,
 	pack_objects.in = -1;
 	pack_objects.out = -1;
 	pack_objects.err = -1;
+	pack_objects.clean_on_exit = 1;
 
 	if (start_command(&pack_objects))
 		die("git upload-pack: unable to fork git-pack-objects");
-- 
2.29.2-538-g65d51b1459
Previous: Jeff KingNext: Jeff King
Message 7 of 16 in “”
  1. 唐宇奕Nov 19, 2020
  2. René ScharfeNov 20, 2020
  3. Jeff KingNov 21, 2020
  4. Junio C HamanoNov 21, 2020
  5. 唐宇奕Nov 24, 2020
  6. Jeff KingNov 24, 2020
  7. Junio C HamanoNov 25, 2020
  8. Jeff KingNov 26, 2020
  9. Junio C HamanoNov 26, 2020
  10. René ScharfeNov 26, 2020
  11. Jeff KingNov 27, 2020
  12. René ScharfeNov 27, 2020
  13. Jeff KingNov 28, 2020
  14. Jeff KingDec 1, 2020
  15. René ScharfeDec 2, 2020
  16. Junio C HamanoDec 2, 2020

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.