From: Jeff King <peff@peff.net>
To: Sitaram Chamarty <sitaramc@gmail.com>
Cc: Jens Lehmann <Jens.Lehmann@web.de>,
Junio C Hamano <gitster@pobox.com>,
"jones.noamle" <lenoam@gmail.com>,
git@vger.kernel.org
Subject: Re: gc does not clean up after itself when not enough disk space
Date: Wed, 27 Feb 2013 00:07:35 -0500 [thread overview]
Message-ID: <20130227050735.GA10976@sigill.intra.peff.net> (raw)
In-Reply-To: <CAMK1S_hxZZzi911s2QRpc67sNf_U7Ceo1fPT_hg1gO500pO=6A@mail.gmail.com>
On Wed, Feb 27, 2013 at 05:58:20AM +0530, Sitaram Chamarty wrote:
> > Ack. I just recently had to do
> >
> > git gc || rm -f .git/objects/*/tmp_*
> >
> > as workaround in the nightly housekeeping script on our CI server.
>
> it's not just 'git gc'; a failed push of a large repo (failed due to,
> say, network issues or whatever) also leave tmp_* lying around. At
> least as far as I can tell...
Yes, we used to run into problems with failed pushes sometimes at
GitHub. A later `git gc` will clean up the tmp_* objects (via `git
prune`), but of course we will not run the prune if the repack fails.
Also note that a push will just keep receiving objects as long as the
client wishes to send them, spooling straight to disk, before any
enforcement hooks have a chance to run. So on stock git, you could in
theory just fill up the receiver's disk, and then git will leave the
file sitting around.
I have a patch to make index-pack just do a hard hangup after receiving
`receive.maximumBytes` bytes (with an appropriate message to stderr).
It's not an exact measure of the size of the push (since we need to
complete thin packs, and we may also explode smaller packs), but it at
least bounds the size that the sender can push. I'm happy to share the
patch if others are interested (it's only a few lines).
I've also considered a patch to have index-pack clean up tmp_pack_*
automatically on exit, default to off (i.e., the current behavior). A
busy site could turn it on globally, and then shut it off for a specific
repo when trying to debug a push problem. I find that the leftover
tmp_pack files are very seldom of interest for forensic debugging. I
haven't bothered to write that patch, though; we dropped our prune
expiration time well below the 2-week default, so the tmp files get
cleaned up pretty regularly now.
-Peff
prev parent reply other threads:[~2013-02-27 5:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <512CD689.4050705@gmail.com>
2013-02-26 15:38 ` gc does not clean up after itself when not enough disk space jones.noamle
2013-02-26 16:07 ` Junio C Hamano
2013-02-26 20:31 ` Jens Lehmann
2013-02-27 0:28 ` Sitaram Chamarty
2013-02-27 5:07 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130227050735.GA10976@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=lenoam@gmail.com \
--cc=sitaramc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).