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

Re: [PATCH v2 1/3] t7519: avoid file to index mtime race for untracked cache

From
Tao Klerks <tao@klerks.biz>
Date
Feb 27, 2022, 22:12 UTC
Message-ID
<CAPMMpoi4oQ4nORc-Jq00pFQq7eFYe0mZhwdU7fvTabvCdL1Okw@mail.gmail.com>
In-Reply-To
<xmqqr17qbw8l.fsf@gitster.g>
On Fri, Feb 25, 2022 at 8:07 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
>
> "Tao Klerks via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > In t7519 there is a test that writes files to disk, and immediately
> > writes the untracked index. Because of mtime-comparison logic that
>
> "untracked cache", I think.
>
Yep, fixed, thx.
Show 10 quoted lines
> > uses a 1-second resolution, this means the cached entries are not
> > trusted/used under some circumstances
> > (see read-cache.c#is_racy_stat()).
> >
> > Untracked cache tests in t7063 use a 1-second delay to avoid this
> > issue, but we don't want to introduce arbitrary slowdowns, so instead
> > use test-tool chmtime to backdate the files slightly.
>
> Good approach.  Perhaps fixing 7063 can be marked as #leftoverbit?
>
Sure. Updated the commit msg.

I also started another thread with what that looks like - it's not very pretty in the end because of Windows compatibility issues, and still incomplete because (as far as I can tell) the sleep is used for a couple of different purposes, and only one of them lends itself to chmtime manipulation.

Previous: Junio C HamanoNext: Tao Klerks via GitGitGadget
Message 12 of 19 in “Empty untracked cache performance issue”
  1. 0/3 Empty untracked cache performance issueTao Klerks via GitGitGadget, Jun 24, 2021
  2. 1/3 Add a second's delay to t7519 for untracked cacheTao Klerks via GitGitGadget, Jun 24, 2021
  3. Junio C HamanoJun 29, 2021
  4. 2/3 In t7519, populate untracked cache before testTao Klerks via GitGitGadget, Jun 24, 2021
  5. 3/3 Write index when populating empty untracked cacheTao Klerks via GitGitGadget, Jun 24, 2021
  6. Junio C HamanoJun 29, 2021
  7. Tao KlerksFeb 24, 2022
  8. Junio C HamanoFeb 24, 2022
  9. 0/3 Empty untracked cache performance issueTao Klerks via GitGitGadget, Feb 25, 2022
  10. 1/3 t7519: avoid file to index mtime race for untracked cacheTao Klerks via GitGitGadget, Feb 25, 2022
  11. Junio C HamanoFeb 25, 2022
  12. Tao KlerksFeb 27, 2022
  13. 2/3 t7519: populate untracked cache before testTao Klerks via GitGitGadget, Feb 25, 2022
  14. 3/3 untracked-cache: write index when populating empty untracked cacheTao Klerks via GitGitGadget, Feb 25, 2022
  15. Junio C HamanoFeb 25, 2022
  16. 0/3 Empty untracked cache performance issueTao Klerks via GitGitGadget, Feb 27, 2022
  17. 1/3 t7519: avoid file to index mtime race for untracked cacheTao Klerks via GitGitGadget, Feb 27, 2022
  18. 2/3 t7519: populate untracked cache before testTao Klerks via GitGitGadget, Feb 27, 2022
  19. 3/3 untracked-cache: write index when populating empty untracked cacheTao Klerks via GitGitGadget, Feb 27, 2022

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.