From 6eafcc78d3b2bcb8da68354ba4c7d4ea96b4d16b Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 23 Aug 2024 10:40:00 +0200 Subject: [PATCH] server: ignore more error kinds in incoming socket stream --- tonic/src/transport/server/incoming.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tonic/src/transport/server/incoming.rs b/tonic/src/transport/server/incoming.rs index 8b9230630..a2963590c 100644 --- a/tonic/src/transport/server/incoming.rs +++ b/tonic/src/transport/server/incoming.rs @@ -91,7 +91,12 @@ fn handle_accept_error(e: impl Into) -> ControlFlow let e = e.into(); tracing::debug!(error = %e, "accept loop error"); if let Some(e) = e.downcast_ref::() { - if e.kind() == io::ErrorKind::ConnectionAborted { + if matches!( + e.kind(), + io::ErrorKind::ConnectionAborted + | io::ErrorKind::Interrupted + | io::ErrorKind::WouldBlock + ) { return ControlFlow::Continue(()); } }