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
唐宇奕 <winglovet@gmail.com>
Date
Nov 24, 2020, 03:21 UTC
Message-ID
<CAFWsj_WsexXgFe-jMYOk8_m9N7GLrhRjqFjRWRePZmxUDEYkSg@mail.gmail.com>
In-Reply-To
<xmqqd006s7ee.fsf@gitster.c.googlers.com>
when will this bug be fixed?
Junio C Hamano <gitster@pobox.com> 于2020年11月22日周日 上午5:54写道:
Show 50 quoted lines
>
> Jeff King <peff@peff.net> writes:
>
> > Yeah, clean_on_exit seems quite reasonable to me. I suspect nobody ever
> > really noticed, because as soon as pack-objects starts to write out the
> > pack, it will get SIGPIPE or EPIPE and die. But there is no point in
> > letting it chug on expensive object enumeration or delta compression if
> > upload-pack has already exited.
> >
> > I don't know that wait_after_clean is necessary. We don't need to wait
> > for pack-objects to fail.
> >
> > On the flip side, one of the reasons I added clean_on_exit long ago was
> > for the similar issue on the push side, which is even worse. Here we
> > might just waste some CPU, but on the push side we connect pack-objects
> > directly to the remote socket, so it could actually complete the push
> > (from the server's perspective) after the local git-push has died. Or at
> > least I think that was possible at one point; it might not be the case
> > any more.
> >
> > I wrote this patch ages ago, and it is still sitting close to the bottom
> > (if not the bottom) of my todo stack, waiting to be investigated. ;)
>
> Sounds sensible.
>
> > -- >8 --
> > Subject: [PATCH] send-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 keep running and
> > complete the push, which may surprise the user. We should
> > take it down when we go down.
> >
> > Signed-off-by: Jeff King <peff@peff.net>
> > ---
> >  send-pack.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/send-pack.c b/send-pack.c
> > index eb4a44270b..d2701bf35c 100644
> > --- a/send-pack.c
> > +++ b/send-pack.c
> > @@ -85,6 +85,7 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *extra, struc
> >       po.in = -1;
> >       po.out = args->stateless_rpc ? -1 : fd;
> >       po.git_cmd = 1;
> > +     po.clean_on_exit = 1;
> >       if (start_command(&po))
> >               die_errno("git pack-objects failed");
Previous: Junio C HamanoNext: Jeff King
Message 5 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.