Retry streaming downloads on broken pipe errors (#13281)

Educated guess at #12359

See
https://github.com/hyperium/h2/blob/adab70fd9f9e5ce3099d274a4b548a27bfdee4dc/src/proto/streams/state.rs#L309-L310
for the error source.
This commit is contained in:
konsti
2025-05-04 14:56:15 +02:00
committed by GitHub
parent 96cfca1c8f
commit e2d105d045
2 changed files with 2 additions and 2 deletions
+1
View File
@@ -497,6 +497,7 @@ pub fn is_extended_transient_error(err: &dyn Error) -> bool {
for io_err in find_sources::<io::Error>(&err) {
if io_err.kind() == io::ErrorKind::ConnectionReset
|| io_err.kind() == io::ErrorKind::UnexpectedEof
|| io_err.kind() == io::ErrorKind::BrokenPipe
{
trace!("Retrying error: `ConnectionReset` or `UnexpectedEof`");
return true;
+1 -2
View File
@@ -623,8 +623,7 @@ impl CachedClient {
.await;
if result
.as_ref()
.err()
.is_some_and(|err| is_extended_transient_error(err))
.is_err_and(|err| is_extended_transient_error(err))
{
let retry_decision = retry_policy.should_retry(start_time, n_past_retries);
if let reqwest_retry::RetryDecision::Retry { execute_after } = retry_decision {