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

Re: [PATCH] reftable: ignore file-in-use errors when unlink(3p) fails on Windows

From
Johannes Sixt <j6t@kdbg.org>
Date
Jan 25, 2025, 08:19 UTC
Message-ID
<6acb9e8a-7014-4605-b8af-59c4584e9fe6@kdbg.org>
In-Reply-To
<20250125-b4-pks-reftable-win32-in-use-errors-v1-1-356dbc783b4f@pks.im>
Am 25.01.25 um 06:41 schrieb Patrick Steinhardt:
Show 15 quoted lines
> While this logic might be sensible in many callsites throughout Git, it
> is less when used in the reftable library. We only use unlink(3) there
> to delete tables which aren't referenced anymore, and the code is very
> aware of the limitations on Windows. As such, all calls to unlink(3p)
> don't perform any error checking at all and are fine with the call
> failing.
> 
> Instead, the library provides the `reftable_stack_clean()` function,
> which Git knows to execute in git-pack-refs(1) after compacting a stack.
> The effect of this function is that all stale tables will eventually get
> deleted once they aren't kept open anymore.
> 
> So while we're fine with unlink(3p) failing, the Windows-emulation of
> that function will still perform several sleeps and ultimately end up
> asking the user:

Why don't the changes that your commits ending at 391bceae4350 ("compat/mingw: support POSIX semantics for atomic renames", 2024-10-27) help in this case, too?

Since the reftable layer is aware of the problem, why don't we just fix it there and instead sweep it under the rug in the compat layer?

-- Hannes
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 2 of 16 in “reftable: ignore file-in-use errors when unlink(3p) fails on Windows”
  1. reftable: ignore file-in-use errors when unlink(3p) fails on WindowsPatrick Steinhardt, Jan 25, 2025
  2. Johannes SixtJan 25, 2025
  3. Patrick SteinhardtJan 25, 2025
  4. Johannes SixtJan 25, 2025
  5. Patrick SteinhardtJan 27, 2025
  6. Johannes SixtJan 28, 2025
  7. Patrick SteinhardtJan 28, 2025
  8. Johannes SixtJan 29, 2025
  9. Christian ReichJan 25, 2025
  10. Patrick SteinhardtJan 27, 2025
  11. Junio C HamanoJan 26, 2025
  12. Patrick SteinhardtJan 27, 2025
  13. reftable: ignore file-in-use errors when unlink(3p) fails on WindowsPatrick Steinhardt, Feb 6, 2025
  14. Christian ReichMar 14, 2025
  15. Patrick SteinhardtMar 14, 2025
  16. Johannes SchindelinMar 15, 2025

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.