From: Jeff King <peff@peff.net>
To: Neal Kreitzinger <nkreitzinger@gmail.com>
Cc: Shawn Pearce <spearce@spearce.org>,
Neal Kreitzinger <neal@rsss.com>,
git@vger.kernel.org
Subject: Re: concurrent fetches to update same mirror
Date: Wed, 5 Jan 2011 17:57:52 -0500 [thread overview]
Message-ID: <20110105225752.GA9774@sigill.intra.peff.net> (raw)
In-Reply-To: <4D24F3E9.3070904@gmail.com>
On Wed, Jan 05, 2011 at 04:42:49PM -0600, Neal Kreitzinger wrote:
> In the case of concurrent pulls to the same non-bare repo, could the
> working tree or index get corrupted, or does git have concurrency
> control mechanisms for this too?
There's a lock on the index, so it shouldn't be corruptable; one process
will just end up waiting. I'm not sure offhand whether writing working
tree files is done under any lock, but I would tend to think not, since
it can be a long process. However, writing the same file twice should be
OK; we unlink the old version and create the new from scratch. So the
first writer will get its write-in-progress unlinked, and the second one
will "win".
-Peff
next prev parent reply other threads:[~2011-01-05 22:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 20:33 concurrent fetches to update same mirror Neal Kreitzinger
2011-01-05 20:47 ` Jeff King
2011-01-05 20:51 ` Shawn Pearce
2011-01-05 20:53 ` Jeff King
2011-01-05 21:13 ` Jeff King
2011-01-05 22:34 ` Neal Kreitzinger
2011-01-05 22:42 ` Neal Kreitzinger
2011-01-05 22:57 ` Jeff King [this message]
2011-01-05 23:29 ` Junio C Hamano
2011-01-06 23:45 ` Jeff King
2011-01-07 14:50 ` Marc Branchaud
2011-01-07 14:51 ` Marc Branchaud
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=20110105225752.GA9774@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=neal@rsss.com \
--cc=nkreitzinger@gmail.com \
--cc=spearce@spearce.org \
/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).