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

Re: [PATCH] index-pack: spawn threads atomically

From
Jeff King <peff@peff.net>
Date
Jan 11, 2024, 06:53 UTC
Message-ID
<20240111065338.GA48154@coredump.intra.peff.net>
In-Reply-To
<ZZ7VEVXSg1T8ZkIK@nand.local>
On Wed, Jan 10, 2024 at 12:34:09PM -0500, Taylor Blau wrote:
Show 14 quoted lines
> > If do go with "--threads=1", I suspect several tests in that file need
> > it.
> 
> Yeah, there are a couple of others. I think the ones that need modifying
> are at the intersection of "expected to fail" and "in a test which is
> expected to pass leak-free":
> 
>     $ grep -l 'TEST_PASSES_SANITIZE_LEAK=true' t????-*.sh |
>       xargs grep -l 'test_must_fail git index-pack'
>     t5302-pack-index.sh
>     t5308-pack-detect-duplicates.sh
>     t5309-pack-delta-cycles.sh
>     t5313-pack-bounds-checks.sh
>     t5325-reverse-index.sh

I think that is more than we need. It's only a problem when we hit a die() inside a thread, which happens only during delta resolution. So your patch 2, for example, touches a test which triggers the --max-input-size check. But we would find that out on the initial unthreaded pass over the pack.

The one in patch 3 seems at first glance like it might be a problem (it's another duplicate-object case, like the one of them in 5309). But it isn't a problem because the duplicate object isn't a delta, so we notice the problem in write_idx_file() from the main thread (which I verified by running it under gdb and setting a breakpoint at die()).

I suspect patch 4 is the same, but didn't run gdb on each case. And patch 5 is about a corrupt reverse index, so almost certainly the main thread. So I suspect that patch 1 is the only one that matters here (and probably all of those are needed, because it is all about broken deltas).

All that said, I am on the fence between the two approaches. If Junio prefers the atomic-spawn direction, I'm fine with that, and there's not much point in polishing the --threads=1 approach further.

-Peff
Previous: Taylor Blau
Message 12 of 12 in “index-pack: spawn threads atomically”
  1. index-pack: spawn threads atomicallyJeff King, Jan 5, 2024
  2. Taylor BlauJan 5, 2024
  3. Jeff KingJan 10, 2024
  4. Taylor BlauJan 10, 2024
  5. 1/5 t5309: run expected-to-fail `index-pack`s with `--threads=1`Taylor Blau, Jan 10, 2024
  6. Junio C HamanoJan 10, 2024
  7. Taylor BlauJan 10, 2024
  8. 2/5 t5302: run expected-to-fail `index-pack`s with `--threads=1`Taylor Blau, Jan 10, 2024
  9. 3/5 t5308: run expected-to-fail `index-pack`s with `--threads=1`Taylor Blau, Jan 10, 2024
  10. 4/5 t5313: run expected-to-fail `index-pack`s with `--threads=1`Taylor Blau, Jan 10, 2024
  11. 5/5 t5325: run expected-to-fail `index-pack`s with `--threads=1`Taylor Blau, Jan 10, 2024
  12. Jeff KingJan 11, 2024

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.