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

Re: [PATCH] perf: work around the tested repo having an index.lock

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 4, 2017, 02:04 UTC
Message-ID
<xmqqwp8sv77h.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170602184506.x2inwswmcwafyvfy@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> But I think a more compelling case is that there may be an ongoing
> operation in the original repo (e.g., say you are in the middle of
> writing a commit message) when we do a blind copy of the filesystem
> contents. You might racily pick up a lockfile.
>
> Should we find and delete all *.lock files in the copied directory? That
> would get ref locks, etc. Half-formed object files are OK. Technically
> if you want to get an uncorrupted repository you'd also want to copy
> refs before objects (in case somebody makes a new object and updates a
> ref while you're copying).
Or "git branch -m A B" is in progress.

I think it all depends on what your "threat" model is ;-). Do we assume that many users are "time-sharing" a box and a repository? If not, i.e. if you are the sole user of a box and a repository on it, such a concurrent access to make the result of git-unaware copy problematic will not be in index.lock (after all you are now doing the perf thing, not editing a commit log message in the repository used for testing Git), but will be in ref locks (somebody else pushing into the repository you are *not* currently using from sideways).

Previous: Junio C HamanoNext: Jeff King
Message 15 of 16 in “perf: work around the tested repo having an index.lock”
  1. perf: work around the tested repo having an index.lockÆvar Arnfjörð Bjarmason, Jun 2, 2017
  2. Jeff KingJun 2, 2017
  3. Ævar Arnfjörð BjarmasonJun 2, 2017
  4. Junio C HamanoJun 2, 2017
  5. Ævar Arnfjörð BjarmasonJun 3, 2017
  6. Junio C HamanoJun 4, 2017
  7. Junio C HamanoJun 4, 2017
  8. Christian CouderJun 4, 2017
  9. Ævar Arnfjörð BjarmasonJun 4, 2017
  10. Jeff KingJun 4, 2017
  11. Junio C HamanoJun 5, 2017
  12. Christian CouderJun 5, 2017
  13. Jeff KingJun 4, 2017
  14. Junio C HamanoJun 5, 2017
  15. Junio C HamanoJun 4, 2017
  16. Jeff KingJun 4, 2017

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.