diff --git a/rust/client-shared/src/eventloop.rs b/rust/client-shared/src/eventloop.rs index 2129d72ef..7ab107866 100644 --- a/rust/client-shared/src/eventloop.rs +++ b/rust/client-shared/src/eventloop.rs @@ -147,11 +147,19 @@ impl Eventloop { .downcast_ref::() .is_some_and(is_unreachable) { - // `NetworkUnreachable`, `HostUnreachable`, `AddrNotAvailable` most likely means we don't have IPv4 or IPv6 connectivity. tracing::debug!("{e:#}"); // Log these on DEBUG so they don't go completely unnoticed. continue; } + // Invalid Input can be all sorts of things but we mostly see it with unreachable addresses. + if e.root_cause() + .downcast_ref::() + .is_some_and(|e| e.kind() == io::ErrorKind::InvalidInput) + { + tracing::debug!("{e:#}"); + continue; + } + if e.root_cause() .is::() { diff --git a/rust/gateway/src/eventloop.rs b/rust/gateway/src/eventloop.rs index ac6c0b961..88fcda4b3 100644 --- a/rust/gateway/src/eventloop.rs +++ b/rust/gateway/src/eventloop.rs @@ -98,16 +98,23 @@ impl Eventloop { continue; } Poll::Ready(Err(e)) => { - if e.root_cause().downcast_ref::().is_some_and(|e| { - e.kind() == io::ErrorKind::NetworkUnreachable - || e.kind() == io::ErrorKind::HostUnreachable - || e.kind() == io::ErrorKind::AddrNotAvailable - }) { - // `NetworkUnreachable`, `HostUnreachable`, `AddrNotAvailable` most likely means we don't have IPv4 or IPv6 connectivity. + if e.root_cause() + .downcast_ref::() + .is_some_and(is_unreachable) + { tracing::debug!("{e:#}"); // Log these on DEBUG so they don't go completely unnoticed. continue; } + // Invalid Input can be all sorts of things but we mostly see it with unreachable addresses. + if e.root_cause() + .downcast_ref::() + .is_some_and(|e| e.kind() == io::ErrorKind::InvalidInput) + { + tracing::debug!("{e:#}"); + continue; + } + if e.root_cause() .downcast_ref::() .is_some_and(|e| e.kind() == io::ErrorKind::PermissionDenied) @@ -663,3 +670,14 @@ fn resolve_address_family(addr: &str, family: i32) -> Result bool { + #[cfg(unix)] + if e.raw_os_error().is_some_and(|e| e == libc::EHOSTDOWN) { + return true; + } + + e.kind() == io::ErrorKind::NetworkUnreachable + || e.kind() == io::ErrorKind::HostUnreachable + || e.kind() == io::ErrorKind::AddrNotAvailable +}