diff --git a/rust/connlib/clients/shared/src/eventloop.rs b/rust/connlib/clients/shared/src/eventloop.rs index c67a340af..378c660fd 100644 --- a/rust/connlib/clients/shared/src/eventloop.rs +++ b/rust/connlib/clients/shared/src/eventloop.rs @@ -89,9 +89,6 @@ where self.handle_tunnel_event(event); continue; } - Poll::Ready(Err(e)) if e.kind() == io::ErrorKind::WouldBlock => { - continue; - } Poll::Ready(Err(e)) if e.kind() == io::ErrorKind::NetworkUnreachable || e.kind() == io::ErrorKind::HostUnreachable => @@ -100,6 +97,11 @@ where continue; } Poll::Ready(Err(e)) => { + debug_assert_ne!( + e.kind(), + io::ErrorKind::WouldBlock, + "Tunnel should never emit WouldBlock errors but suspend instead" + ); telemetry_event!("Tunnel error: {}", err_with_src(&e)); continue; } diff --git a/rust/gateway/src/eventloop.rs b/rust/gateway/src/eventloop.rs index 67216120b..ec0c04ab4 100644 --- a/rust/gateway/src/eventloop.rs +++ b/rust/gateway/src/eventloop.rs @@ -77,9 +77,6 @@ impl Eventloop { self.handle_tunnel_event(event); continue; } - Poll::Ready(Err(e)) if e.kind() == io::ErrorKind::WouldBlock => { - continue; - } Poll::Ready(Err(e)) if e.kind() == io::ErrorKind::NetworkUnreachable || e.kind() == io::ErrorKind::HostUnreachable => @@ -88,6 +85,12 @@ impl Eventloop { continue; } Poll::Ready(Err(e)) => { + debug_assert_ne!( + e.kind(), + io::ErrorKind::WouldBlock, + "Tunnel should never emit WouldBlock errors but suspend instead" + ); + let e = anyhow::Error::from(e); if e.root_cause().is::() {