git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: 唐宇奕 <winglovet@gmail.com>, git@vger.kernel.org
Subject: Re: Bug report: orphaned pack-objects after killing upload-pack on [was: (no subject)]
Date: Fri, 20 Nov 2020 19:52:45 +0100	[thread overview]
Message-ID: <badf3777-3970-b714-3ad9-67d2f77f94a5@web.de> (raw)
In-Reply-To: <CAFWsj_UwkQX9y0xPQJE3xguo0z3TMkvKAwei5iryCWXvVP8CjA@mail.gmail.com>

Am 19.11.20 um 09:18 schrieb 唐宇奕:
> 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

  reply	other threads:[~2020-11-20 20:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19  8:18 唐宇奕
2020-11-20 18:52 ` René Scharfe [this message]
2020-11-21  0:29   ` Bug report: orphaned pack-objects after killing upload-pack on [was: (no subject)] Jeff King
2020-11-21 21:54     ` Bug report: orphaned pack-objects after killing upload-pack on [ Junio C Hamano
2020-11-24  3:21       ` 唐宇奕
2020-11-24  9:11       ` Jeff King
2020-11-25 21:42         ` Junio C Hamano
2020-11-26  0:53           ` Jeff King
2020-11-26  1:04             ` Junio C Hamano
2020-11-26 20:04               ` René Scharfe
2020-11-27  4:17                 ` Jeff King
2020-11-27 20:43                   ` René Scharfe
2020-11-28  6:30                     ` Jeff King
2020-12-01 12:15                 ` Jeff King
2020-12-02 11:45                   ` René Scharfe
2020-12-02 22:14                     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=badf3777-3970-b714-3ad9-67d2f77f94a5@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=winglovet@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).