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

Re: [PATCH 1/8] t: fix races caused by background maintenance

From
Patrick Steinhardt <ps@pks.im>
Date
Aug 10, 2026, 05:20 UTC
Message-ID
<anlfk0P7UillhlUd@pks.im>
In-Reply-To
<17d460c0-564e-45fd-830e-548f60e01e01@haller-berlin.de>
On Mon, Aug 10, 2026 at 06:43:45AM +0200, Stefan Haller wrote:
Show 15 quoted lines
> On 20.02.26 11:15, Patrick Steinhardt wrote:
> > Introduce a new `GIT_TEST_MAINT_AUTO_DETACH` environment variable that
> > allows us to override the auto-detach behaviour and set that varibale in
> > our tests.
> I have just run into this problem with the lazygit test suite, and I
> worked around it there by turning off auto maintenance altogether. Some
> more details of how this affected us and why can be found in [1].
> 
> I'm fine with that solution, but I do wonder why we think this doesn't
> also affect ordinary usage. Lazygit's integration test suite doesn't do
> anything special, it simply executes git commands like a normal user
> would. Maybe a bit faster than a normal user would type them, but for
> scripts that create a bunch of files, stage them, and commit them, I see
> no reason why they shouldn't run into the same problem. Or am I missing
> something?

It does affect ordinary usage, but the expectation is that a "normal" user should not care about repository maintenance running in parallel to us. It should be completely transparent to them in the best case. Git commands should just work with concurrent maintenance, and if they don't then it's worth to have a deeper look at why it doesn't.

The reason why it's not fine for the Git test suite is that in lots of cases we assume a lot about the on-disk state of the repository. We are often reaching into internals to verify that it looks as expected, and that is of course racing with concurrent maintenance. And hence we have to be more careful than users, as they are not supposed to reach into repository internals without Git or an implementation thereof.

Patrick
Previous: Stefan HallerNext: Stefan Haller
Message 5 of 38 in “builtin/maintenance: use "geometric" strategy by default”
  1. 0/8 builtin/maintenance: use "geometric" strategy by defaultPatrick Steinhardt, Feb 20, 2026
  2. 1/8 t: fix races caused by background maintenancePatrick Steinhardt, Feb 20, 2026
  3. Justin ToblerFeb 23, 2026
  4. Stefan HallerAug 10, 2026
  5. Patrick SteinhardtAug 10, 2026
  6. Stefan HallerAug 10, 2026
  7. Patrick SteinhardtAug 10, 2026
  8. Stefan HallerAug 10, 2026
  9. Patrick SteinhardtAug 10, 2026
  10. Stefan HallerAug 10, 2026
  11. 2/8 t: disable maintenance where we verify object database structurePatrick Steinhardt, Feb 20, 2026
  12. Justin ToblerFeb 23, 2026
  13. 3/8 t34xx: don't expire reflogs where it mattersPatrick Steinhardt, Feb 20, 2026
  14. Derrick StoleeFeb 23, 2026
  15. Justin ToblerFeb 23, 2026
  16. 4/8 t5400: explicitly use "gc" strategyPatrick Steinhardt, Feb 20, 2026
  17. 5/8 t5510: explicitly use "gc" strategyPatrick Steinhardt, Feb 20, 2026
  18. 6/8 t6500: explicitly use "gc" strategyPatrick Steinhardt, Feb 20, 2026
  19. 7/8 t7900: prepare for switch of the default strategyPatrick Steinhardt, Feb 20, 2026
  20. 8/8 builtin/maintenance: use "geometric" strategy by defaultPatrick Steinhardt, Feb 20, 2026
  21. Derrick StoleeFeb 23, 2026
  22. Patrick SteinhardtFeb 23, 2026
  23. Justin ToblerFeb 23, 2026
  24. Patrick SteinhardtFeb 24, 2026
  25. Derrick StoleeFeb 23, 2026
  26. 0/8 builtin/maintenance: use "geometric" strategy by defaultPatrick Steinhardt, Feb 24, 2026
  27. 1/8 t: fix races caused by background maintenancePatrick Steinhardt, Feb 24, 2026
  28. 2/8 t: disable maintenance where we verify object database structurePatrick Steinhardt, Feb 24, 2026
  29. 3/8 t34xx: don't expire reflogs where it mattersPatrick Steinhardt, Feb 24, 2026
  30. 4/8 t5400: explicitly use "gc" strategyPatrick Steinhardt, Feb 24, 2026
  31. 5/8 t5510: explicitly use "gc" strategyPatrick Steinhardt, Feb 24, 2026
  32. 6/8 t6500: explicitly use "gc" strategyPatrick Steinhardt, Feb 24, 2026
  33. Toon ClaesFeb 25, 2026
  34. 7/8 t7900: prepare for switch of the default strategyPatrick Steinhardt, Feb 24, 2026
  35. 8/8 builtin/maintenance: use "geometric" strategy by defaultPatrick Steinhardt, Feb 24, 2026
  36. Derrick StoleeFeb 24, 2026
  37. Toon ClaesFeb 25, 2026
  38. Justin ToblerFeb 24, 2026

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.