Skip to content

Commit

Permalink
server: ignore more error kinds in incoming socket stream
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Aug 23, 2024
1 parent c3be20c commit 6eafcc7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tonic/src/transport/server/incoming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ fn handle_accept_error(e: impl Into<crate::Error>) -> ControlFlow<crate::Error>
let e = e.into();
tracing::debug!(error = %e, "accept loop error");
if let Some(e) = e.downcast_ref::<io::Error>() {
if e.kind() == io::ErrorKind::ConnectionAborted {
if matches!(
e.kind(),
io::ErrorKind::ConnectionAborted
| io::ErrorKind::Interrupted
| io::ErrorKind::WouldBlock
) {
return ControlFlow::Continue(());
}
}
Expand Down

0 comments on commit 6eafcc7

Please sign in to comment.