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

Re: [PATCH v3] gc: save log from daemonized gc --auto and print it next time

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 31, 2015, 10:17 UTC
Message-ID
<CACsJy8Dd9OCpsytFDDwh8maBfTc1wLs+UKJMPdZngiBaJgr7pA@mail.gmail.com>
In-Reply-To
<xmqqtwrnz2ar.fsf@gitster.dls.corp.google.com>
On Wed, Aug 26, 2015 at 12:49 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 30 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> While commit 9f673f9 (gc: config option for running --auto in
>> background - 2014-02-08) helps reduce some complaints about 'gc
>> --auto' hogging the terminal, it creates another set of problems.
>>
>> The latest in this set is, as the result of daemonizing, stderr is
>> closed and all warnings are lost. This warning at the end of cmd_gc()
>> is particularly important because it tells the user how to avoid "gc
>> --auto" running repeatedly. Because stderr is closed, the user does
>> not know, naturally they complain about 'gc --auto' wasting CPU.
>>
>> Daemonized gc now saves stderr to $GIT_DIR/gc.log. Following gc runs
>> will not be daemonized and gc.log printed out until the user removes
>> gc.log.
>>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>>  Let's try again. Compared to v2 [1], this version does not delete
>>  gc.log automatically any more. The user needs to take action, then
>>  delete gc.log to bring it background again.
>
> Sounds a bit more sensible, but I wonder if it is a good idea to
> keep going in the first place.  If the last gc run reported an
> issue, would it make it likely that we would hit the same issue?
>
> An alternative design I have in mind is to exit "gc --auto" with
> success without doing anything, after giving the new warning
> message.  What would be the pros-and-cons between this patch and
> that alternative design?

I think the alt. design is better. If anything, keep runing may produce more output and probably distract the user from the real warning. We only want to keep doing something again if it can gain us something. If we succeed at steps A and B, then fail at C. Doing A and B again next time might be worth something in general, but given the context of git-gc I don't think it is.

-- 
Duy
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 5 of 17 in “Since gc.autodetach=1 you can end up with auto-gc on every command with no user notification”
  1. Ævar Arnfjörð BjarmasonJul 8, 2015
  2. Duy NguyenJul 8, 2015
  3. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Aug 22, 2015
  4. Junio C HamanoAug 25, 2015
  5. Duy NguyenAug 31, 2015
  6. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Sep 13, 2015
  7. Junio C HamanoSep 14, 2015
  8. Junio C HamanoSep 14, 2015
  9. Michael HaggertySep 16, 2015
  10. Junio C HamanoSep 16, 2015
  11. Michael HaggertySep 17, 2015
  12. Duy NguyenSep 17, 2015
  13. Junio C HamanoSep 17, 2015
  14. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Sep 19, 2015
  15. Junio C HamanoSep 21, 2015
  16. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Sep 19, 2015
  17. Junio C HamanoSep 21, 2015

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.