git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Langhoff <martin.langhoff@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: Sam Coffland <sam.coffland@remote-learner.net>
Subject: Re: Can a git push over ssh trigger a gc/repack? Diagnosing pack explosion
Date: Thu, 21 Nov 2013 10:35:39 -0500	[thread overview]
Message-ID: <CACPiFC+xbnYjZUG49Em=aDUXnS_3_Cp=ZZBCrQCHM-sL78HCdA@mail.gmail.com> (raw)
In-Reply-To: <CACPiFC+TqD_DhMaG+posoK4fTOLCoi=3jhJUPjt_72HTm9xjeQ@mail.gmail.com>

On Thu, Nov 21, 2013 at 10:21 AM, Martin Langhoff
<martin.langhoff@gmail.com> wrote:
> Do client pushes over git+ssh ever trigger a repack on the server?

man git-config
[snip]

       receive.autogc
           By default, git-receive-pack will run "git-gc --auto" after
           receiving data from git-push and updating refs. You can stop it by
           setting this variable to false.

Oooooops!

Ok, couple problems here:

 - if it's receiving from many pushers, it races with itself; needs
some lock or back-off mechanism

 - alternatively, an splay mechanism. We have a "hard" threshold...
given many "pushers" acting in parallel, they'll all hit the threshold
at the same time. There is no need for this, we could randomize the
threshold by 20%; that would radically reduce the racy-ness

 - auto repack in this scenario has a reasonable likelihood if being
visited by the OOM killer -- therefore it needs to fail more
gracefully, for example with tmpfile cleanup. Perhaps by having the
tmpfiles places in a tmpdir named with the pid of the child would make
this easier...

Naturally, I'll move quickly to disable this evil-spawn-automagic
setting and setup a cronjob. But I think it is possible to have
defaults that work more reliably and with lower risk of explosion.

thoughts?



m
-- 
 martin.langhoff@gmail.com
 -  ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 ~ http://docs.moodle.org/en/User:Martin_Langhoff

  reply	other threads:[~2013-11-21 15:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 15:21 Can a git push over ssh trigger a gc/repack? Diagnosing pack explosion Martin Langhoff
2013-11-21 15:35 ` Martin Langhoff [this message]
2013-11-21 19:52   ` Junio C Hamano
2013-11-21 21:57     ` Martin Langhoff

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='CACPiFC+xbnYjZUG49Em=aDUXnS_3_Cp=ZZBCrQCHM-sL78HCdA@mail.gmail.com' \
    --to=martin.langhoff@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sam.coffland@remote-learner.net \
    /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).