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:
*
15cd6fa1fc/src/proto/h1/decode.rs (L683)
*
15cd6fa1fc/src/proto/h1/decode.rs (L161-L164)
This commit is contained in:
konsti 2024-07-29 15:53:23 +02:00 committed by GitHub
parent 24472108fe
commit 0877f76aae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
}