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

Re: Bug report: orphaned pack-objects after killing upload-pack on [was: (no subject)]

From
René Scharfe <l.s.r@web.de>
Date
Nov 20, 2020, 18:52 UTC
Message-ID
<badf3777-3970-b714-3ad9-67d2f77f94a5@web.de>
In-Reply-To
<CAFWsj_UwkQX9y0xPQJE3xguo0z3TMkvKAwei5iryCWXvVP8CjA@mail.gmail.com>
Am 19.11.20 um 09:18 schrieb 唐宇奕:
Show 30 quoted lines
> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.
>
> What did you do before the bug happened? (Steps to reproduce your issue)
>   1. linux environment, prepare a large repo to give you enough time to debug
>   2. clone that repo
>   3. during clone, send SIGTERM to the git-upload-pack process
>
> What did you expect to happen? (Expected behavior)
>   there is no git process left
>
> What happened instead? (Actual behavior)
>   there is a git pack-objects process which is forked by the
> git-upload-pack process, it becomes a zombie
>
> What's different between what you expected and what actually happened?
>   there shouldn't exist zombie processes
>
> Anything else you want to add:
>   you may need a docker container environment to reproduce this since
> mostly init process will cleanup zombie processes for you
>
> Please review the rest of the bug report below.
> You can delete any lines you don't wish to share.
>
>
> [System Info]
> git version:
> git version 2.26.2
> cpu: x86_64
Have you seen this working as you expect in an earlier version?

I suspect it's a matter of turning on some flags (patch below), but I have to admit I don't really know what I'm doing here -- and why this hasn't been done already.

René
---
 upload-pack.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/upload-pack.c b/upload-pack.c
index 5dc8e1f844..e42dea26fa 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -321,6 +321,8 @@ 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;
+	pack_objects.wait_after_clean = 1;

 	if (start_command(&pack_objects))
 		die("git upload-pack: unable to fork git-pack-objects");
--
2.29.2
Previous: 唐宇奕Next: Jeff King
Message 2 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.