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:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user