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

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

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 25, 2015, 00:58 UTC
Message-ID
<CACsJy8Acw8u8mbW6ivoUN10462xJDZxK984Vc2E3eypTc3qJ7A@mail.gmail.com>
In-Reply-To
<xmqqy4mm3v8l.fsf@gitster.dls.corp.google.com>
On Wed, Mar 25, 2015 at 5:07 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
>> +             LANG=C git gc --auto &&
>> +             sleep 1 && # give it time to daemonize
>> +             while test -f .git/gc.pid; do sleep 1; done &&
>
> Yuck...

Yeah.. it's hard to test daemon things. I'm not even sure if we should add a test, but I tried anyway.

Show 17 quoted lines
>> +             grep "too many unreachable loose objects" .git/gc.log &&
>> +             LANG=C git gc --auto 2>error &&
>> +             grep skipped error &&
>> +             grep "too many unreachable loose objects" error &&
>> +             ! test -f .git/gc.log
>> +     )
>> +'
>
> For that "17/ has very many loose objects that are still young and
> unreachable" issue, I wonder if the right solution is somehow to
> flag the repository and prevent "gc --auto" from running until the
> situation improves.  "I checked at this time and found too many in
> 17/"; upon finding that flag file (with a timestamp), if there are
> new files in 17/ or if there are other reasons to do a gc (perhaps
> there are too many packfiles to be consolidated?), then do the gc
> but otherwise quit silently before spending too many cycles on it,
> or something along that line?

That's a separate problem that's being discussed in another thread. I think Jeff's idea of storing the number of estimated loose objects may be more reliable than timestamps..

-- 
Duy
Previous: Junio C HamanoNext: Eric Sunshine
Message 3 of 6 in “gc: save log from daemonized gc --auto and print it next time”
  1. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Mar 24, 2015
  2. Junio C HamanoMar 24, 2015
  3. Duy NguyenMar 25, 2015
  4. Eric SunshineMar 24, 2015
  5. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Mar 26, 2015
  6. Junio C HamanoMar 26, 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.