From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 141C61F5AE for ; Tue, 18 May 2021 12:08:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244471AbhERMJR (ORCPT ); Tue, 18 May 2021 08:09:17 -0400 Received: from cloud.peff.net ([104.130.231.41]:57746 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244000AbhERMJP (ORCPT ); Tue, 18 May 2021 08:09:15 -0400 Received: (qmail 14582 invoked by uid 109); 18 May 2021 12:07:57 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 18 May 2021 12:07:57 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 7421 invoked by uid 111); 18 May 2021 12:07:56 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 18 May 2021 08:07:56 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 18 May 2021 08:07:56 -0400 From: Jeff King To: Bagas Sanjaya Cc: Git Users Subject: Re: git repack on shallow clone of large repo (linux kernel) hangs at "Enumerating objects" Message-ID: References: <158a2f8c-95c0-075a-4cda-6328324c2261@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <158a2f8c-95c0-075a-4cda-6328324c2261@gmail.com> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, May 18, 2021 at 06:23:40PM +0700, Bagas Sanjaya wrote: > > 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: > > > 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. You need "strace -f". The parent repack process spawns pack-objects (via the clone() call above), and then waits for it to print the name of the generated pack at the end. So it will stall on that read() for quite a while, even under normal circumstances. -Peff