From 94e319d2fa87b4afa1e3ffda34e25a056fde45da Mon Sep 17 00:00:00 2001 From: nielash Date: Thu, 24 Sep 2026 08:47:08 -0400 Subject: [PATCH] fs: retry "network is unreachable" and "network is down" errors ENETUNREACH and ENETDOWN were not in the list of retriable errors on non-Windows platforms, so a single failed connection aborted the transfer instead of being retried as a low level retry. The Windows list already includes the equivalent WSAENETUNREACH and WSAENETDOWN. This is easy to hit on a host with IPv6 enabled but no IPv6 route: if the A lookup fails transiently while the AAAA lookup succeeds, the only address to dial is IPv6 and the connect fails with ENETUNREACH. A retry resolves again and normally succeeds. --- fs/fserrors/error_syscall_test.go | 2 ++ fs/fserrors/retriable_errors.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/fs/fserrors/error_syscall_test.go b/fs/fserrors/error_syscall_test.go index 974b89411..e752307d5 100644 --- a/fs/fserrors/error_syscall_test.go +++ b/fs/fserrors/error_syscall_test.go @@ -49,6 +49,8 @@ func TestWithSyscallShouldRetry(t *testing.T) { want bool }{ {makeNetErr(syscall.EAGAIN), true}, + {makeNetErr(syscall.ENETDOWN), true}, + {makeNetErr(syscall.ENETUNREACH), true}, {makeNetErr(syscall.Errno(123123123)), false}, { wrap(&url.Error{ diff --git a/fs/fserrors/retriable_errors.go b/fs/fserrors/retriable_errors.go index bd24f0a8e..c8b19c6ef 100644 --- a/fs/fserrors/retriable_errors.go +++ b/fs/fserrors/retriable_errors.go @@ -13,6 +13,8 @@ func init() { syscall.ECONNREFUSED, syscall.EHOSTDOWN, syscall.EHOSTUNREACH, + syscall.ENETDOWN, + syscall.ENETUNREACH, syscall.ECONNABORTED, syscall.EAGAIN, syscall.EWOULDBLOCK,