Skip to main content

is_transient_fetch_error

Function is_transient_fetch_error 

Source
pub fn is_transient_fetch_error(err: &Error) -> bool
Expand description

Whether a failed fetch/fetch_branch/remote_branch_exists looks transient (DNS, a dropped connection, a fast network blip) and is worth retrying.

A processkit-level timeout is deliberately not classified transient (R6). A .timeout()-bounded run that expired has already consumed the caller’s full deadline — retrying it would multiply the wall-clock by FETCH_ATTEMPTS (e.g. a black-holed remote under a 120 s deadline would block ≈ 6 min, three times the advertised ceiling). The deadline is the patience budget; a caller who wants longer should raise the timeout, not have it silently tripled. Fast transient failures (the io-level and marker cases below) still retry, because they fail quickly and a retry is cheap.