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

Re: git repack on shallow clone of large repo (linux kernel) hangs at "Enumerating objects"

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
May 18, 2021, 11:23 UTC
Message-ID
<158a2f8c-95c0-075a-4cda-6328324c2261@gmail.com>
In-Reply-To
<YKIulliGp8hyf5Y6@coredump.intra.peff.net>
Hi Jeff,
Show 8 quoted lines
> You could try using strace or gdb to see what it's doing.
> 
> But as a guess, one thing that sometimes causes a stall near the end of
> "enumerating objects" is loosening unreachable objects that are
> currently packed. You told repack to use "-A", which asks to loosen
> those objects so they aren't lost when the old packs are deleted (as
> opposed to "-a").
> 

I attached two strace logs, one for "git repack -A -d" and one for "git repack -a -d".

For the former, I got following excerpt before I had to SIGINT the process:
Show 16 quoted lines
> stat("/opt/git/libexec/git-core/git", {st_mode=S_IFREG|0755, st_size=22096480, ...}) = 0
> pipe([5, 7])                            = 0
> openat(AT_FDCWD, "/dev/null", O_RDWR|O_CLOEXEC) = 8
> fcntl(8, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
> fcntl(8, F_SETFD, FD_CLOEXEC)           = 0
> rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
> clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7feb5ecbfa10) = 13691
> rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
> close(7)                                = 0
> read(5, "", 8)                          = 0
> close(5)                                = 0
> close(8)                                = 0
> close(4)                                = 0
> fcntl(3, F_GETFL)                       = 0 (flags O_RDONLY)
> fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
> read(3, 0x55a540de5250, 4096)           = ? ERESTARTSYS (To be restarted if SA_RESTART is set)

I thought that in the case of "git repack -A -d", it is stucked at the last read() before I ctrl-c'ed to trigger SIGINT.

Show 10 quoted lines
> You'd probably want to at least say "--unpack-unreachable=some.time" to
> avoid writing out ones which are not even recent (and which is what "git
> gc" will do under the hood).
>> But if you don't care about keeping them at all (e.g., because this is
> not an active repository where other simultaneous operations may be
> taking place, so you know it is safe to delete even recent ones), then
> just "git repack -a -d" is probably your best bet.
> 
> -Peff
> 
Using "-a" instead of "-A" on git repack works. Thanks.
-- 
An old man doll... just what I always wanted! - Clara
Previous: Jeff KingNext: Jeff King
Message 3 of 6 in “git repack on shallow clone of large repo (linux kernel) hangs at "Enumerating objects"”
  1. Bagas SanjayaMay 16, 2021
  2. Jeff KingMay 17, 2021
  3. Bagas SanjayaMay 18, 2021
  4. Jeff KingMay 18, 2021
  5. Bagas SanjayaMay 22, 2021
  6. Jeff KingMay 22, 2021

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.