Files
dagu/internal
Yota HamadaandClaude Fable 5.1 b142b251da Retry the rename that re-points a symlink while Windows refuses it (#3556)
TestEntryReaderPollsSymlinkTargets/Recursive fails on windows-latest now
and then: the rename of a.yaml.staged over a.yaml returns "Access is
denied". The test re-points the link with a single rename, as nix
home-manager does, while the entry reader polls the link every 50 ms.

On Windows a rename over a file is refused while any handle to that file
is open, whatever its share mode and even when it only reads attributes,
as os.Stat and os.Lstat do. Probing on Windows 11, a goroutine looping
os.Stat on a regular file made about 8% of concurrent renames over it
fail with access denied, as did an attribute-only CreateFile with every
share mode including FILE_SHARE_DELETE; only os.ReadDir on the directory
never did. The reader has to open the link to learn where it points, so
no reader-side change can close the window; a tool that swaps files on
Windows retries the rename instead, as cmd/go's robustio does.

repointSymlink now renames through renameOverWatchedFile, which on
Windows retries a rename refused with access denied for up to five
seconds. Elsewhere a rename replaces an open file at once and the helper
renames once.

Fixes #3551

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-04 20:43:56 +09:00
..
2026-11-01 22:18:55 +09:00
2026-08-29 00:54:05 +09:00