From 39a22ff7f0c0240b6f284fc9328d6cd5f62e0e84 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 28 Jul 2020 11:33:10 -0700 Subject: [PATCH] Flag git http errors as maybe spurious This showed up in #8544 with an error message of "stream ended at an unexpected time; class=Http" which sounds like a spurious error. Termination of a network connection can happen at any time! For now try to assist in that error by adding another class of error to the list of maybe spurious errors. --- src/cargo/util/network.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cargo/util/network.rs b/src/cargo/util/network.rs index 0850e8b5241..48f8f0baef0 100644 --- a/src/cargo/util/network.rs +++ b/src/cargo/util/network.rs @@ -36,7 +36,10 @@ impl<'a> Retry<'a> { fn maybe_spurious(err: &Error) -> bool { if let Some(git_err) = err.downcast_ref::() { match git_err.class() { - git2::ErrorClass::Net | git2::ErrorClass::Os | git2::ErrorClass::Zlib => return true, + git2::ErrorClass::Net + | git2::ErrorClass::Os + | git2::ErrorClass::Zlib + | git2::ErrorClass::Http => return true, _ => (), } }