Skip to content

Commit 4525c70

Browse files
committed
feat(retry): retry on h2 go away with no error
1 parent 4ec6a70 commit 4525c70

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

client/src/middleware/retry_closed_connection.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ where
4444
return Err(Error::H1(crate::h1::Error::Io(err)));
4545
}
4646
}
47+
Err(Error::H2(crate::h2::Error::H2(err))) => {
48+
if !err.is_go_away() {
49+
return Err(Error::H2(crate::h2::Error::H2(err)));
50+
}
51+
52+
let reason = err.reason().unwrap();
53+
54+
if reason != h2::Reason::NO_ERROR {
55+
return Err(Error::H2(crate::h2::Error::H2(err)));
56+
}
57+
}
4758
Err(Error::H2(crate::h2::Error::Io(err))) => {
4859
if err.kind() != io::ErrorKind::UnexpectedEof {
4960
return Err(Error::H2(crate::h2::Error::Io(err)));

0 commit comments

Comments
 (0)