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, 14:28 UTC
Message-ID
<267314c0-3aba-4f69-9f41-89392391290f@kdbg.org>
In-Reply-To
<Z5ShoLCWREAsWZVh@pks.im>
Am 25.01.25 um 09:32 schrieb Patrick Steinhardt:
> The user report was explicitly about compatibility with JGit, which
> still had these files open. We don't have control over third-party
> clients and how exactly they open files, so it is expected that we may
> still see failures with the deletion of in-use files.
Fair enough.
> I'd be happy to hear about alternative ideas that didn't came to my
> mind.

Instead of calling _wunlink() in mingw_unlink, we could CreateFileW() with access mode DELETE and flag FILE_FLAG_DELETE_ON_CLOSE, then close the file right away. That would apply semantics that is similar, but not quite, POSIX at least among the files that we open ourselves.

It would be even better that we do not depend on the POSIX behavior in the first place. As you said, the reftable library can live with failed deletes. And I don't think we depend on the POSIX behavior anywhere else because we would see the "try again?" question much more frequently than we do right now.

-- Hannes
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 4 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.