authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-09-26 20:11:45-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-09-26 20:11:45-07:00
log36a308ce42b8dc8c33c733b587152ee533b4bbd4
treebb1f67a088d3a4ceac6817829e1448495abf1f7b
parent738fb7835f366dab6bc15ddbaecc0b334f2bb1f9

Threaded: Reduce the number of Windows rename ACCESS_DENIED retries to 3


1 files changed, 6 insertions(+), 2 deletions(-)

lib/std/Io/Threaded.zig+6-2
......@@ -1569,6 +1569,10 @@ const poll_buffer_len = 64;
15691569pub const default_PATH = "/usr/local/bin:/bin:/usr/bin";
15701570/// There are multiple kernel bugs being worked around with retries.
15711571const max_windows_kernel_bug_retries = 13;
1572/// Similar in nature to `max_windows_kernel_bug_retries`, but much more likely to
1573/// be a real error that won't go away after a retry, so the number of retries
1574/// is lower.
1575const max_windows_rename_retries = 3;
15721576
15731577comptime {
15741578 if (@TypeOf(posix.IOV_MAX) != void) assert(max_iovecs_len <= posix.IOV_MAX);
......@@ -7738,7 +7742,7 @@ fn dirRenameWindowsInner(
77387742 },
77397743 .ACCESS_DENIED => {
77407744 syscall.finish();
7741 if (max_windows_kernel_bug_retries - attempt == 0) break :need_fallback false;
7745 if (max_windows_rename_retries - attempt == 0) break :need_fallback false;
77427746 try parking_sleep.sleep(.{ .duration = .{
77437747 .raw = .fromMilliseconds((@as(u32, 1) << attempt) >> 1),
77447748 .clock = .awake,
......@@ -7775,7 +7779,7 @@ fn dirRenameWindowsInner(
77757779 .CANCELLED => try syscall.checkCancel(),
77767780 .ACCESS_DENIED => {
77777781 syscall.finish();
7778 if (max_windows_kernel_bug_retries - attempt == 0) break;
7782 if (max_windows_rename_retries - attempt == 0) break;
77797783 try parking_sleep.sleep(.{ .duration = .{
77807784 .raw = .fromMilliseconds((@as(u32, 1) << attempt) >> 1),
77817785 .clock = .awake,