Retry on incomplete body (#5555)
This is an attempt to add https://github.com/astral-sh/uv/issues/3514#issuecomment-2253562096 to retrying. Relevant hyper code: * https://github.com/hyperium/hyper/blob/15cd6fa1fc52f88b58283a673c134a97bea275d3/src/proto/h1/decode.rs#L683 * https://github.com/hyperium/hyper/blob/15cd6fa1fc52f88b58283a673c134a97bea275d3/src/proto/h1/decode.rs#L161-L164
This commit is contained in:
@@ -290,7 +290,9 @@ fn is_extended_transient_error(res: &Result<Response, reqwest_middleware::Error>
|
||||
// Check for connection reset errors, these are usually `Body` errors which are not retried by default.
|
||||
if let Err(reqwest_middleware::Error::Reqwest(err)) = res {
|
||||
if let Some(io) = find_source::<std::io::Error>(&err) {
|
||||
if io.kind() == std::io::ErrorKind::ConnectionReset {
|
||||
if io.kind() == std::io::ErrorKind::ConnectionReset
|
||||
|| io.kind() == std::io::ErrorKind::UnexpectedEof
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user