diff --git a/app/buck2_core/src/fs/fs_util.rs b/app/buck2_core/src/fs/fs_util.rs index b0ff1fb553617..b549672e629e0 100644 --- a/app/buck2_core/src/fs/fs_util.rs +++ b/app/buck2_core/src/fs/fs_util.rs @@ -55,7 +55,9 @@ pub struct IoError { } fn is_retryable(err: &io::Error) -> bool { - cfg!(target_os = "macos") && err.kind() == io::ErrorKind::TimedOut + cfg!(target_os = "macos") + && (err.kind() == io::ErrorKind::TimedOut + || err.kind() == io::ErrorKind::StaleNetworkFileHandle) } static MAX_IO_ATTEMPTS: u32 = 3; @@ -1391,6 +1393,14 @@ mod tests { get_test_path("test_timeout", &tempdir), (ErrorKind::TimedOut, expected_attempts, should_succeed), ); + test_cases.insert( + get_test_path("test_stale", &tempdir), + ( + ErrorKind::StaleNetworkFileHandle, + expected_attempts, + should_succeed, + ), + ); // These test cases should behave the same on all platforms test_cases.insert(