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

Order of operations at the end of fast-import?

From
Mike Hommey <mh@glandium.org>
Date
Apr 16, 2020, 04:24 UTC
Message-ID
<20200416042449.ztgyrdunsrzt7avp@glandium.org>
Hi,
I just noticed that the order of operations at the end of fast-import
are:
- end_packfile
- dump_branches
- dump_tags

The first may create loose objects if the pack is small (per fastimport.unpackLimit, defaulting to 100). The latter two create refs.

There seems to be a theoretical race condition here, if something else triggers a gc at the "wrong" time, the loose objects might be cleaned up and the branches/tags refs become dangling.

I understand that the packfile does need to be finished before creating the refs, and that the unpacking replaces that when there aren't enough objects, but wouldn't it be more data-safe to actually finish the pack, create the refs, and then unpack?

Mike
Next: Jeff King
Message 1 of 5 in “Order of operations at the end of fast-import?”
  1. Mike HommeyApr 16, 2020
  2. Jeff KingApr 16, 2020
  3. Johannes SixtApr 16, 2020
  4. Jeff KingApr 16, 2020
  5. Mike HommeyApr 16, 2020

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.