From e36f1fa9364018d34e4f0dcefe096913674ef592 Mon Sep 17 00:00:00 2001 From: DuProcess <273172371+DuProcess@users.noreply.github.com> Date: Thu, 16 Jul 2026 21:09:42 -0400 Subject: [PATCH] Treat portable UDP churn errors as transient --- src/udp.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/udp.rs b/src/udp.rs index ef19585..e9038fd 100644 --- a/src/udp.rs +++ b/src/udp.rs @@ -10,6 +10,11 @@ pub fn is_transient_udp_error(err: &std::io::Error) -> bool { std::io::ErrorKind::Interrupted | std::io::ErrorKind::TimedOut | std::io::ErrorKind::WouldBlock + | std::io::ErrorKind::ConnectionRefused + | std::io::ErrorKind::ConnectionReset + | std::io::ErrorKind::AddrNotAvailable + | std::io::ErrorKind::NetworkUnreachable + | std::io::ErrorKind::HostUnreachable ) || err.raw_os_error().is_some_and(is_transient_udp_os_error) } @@ -129,6 +134,11 @@ mod tests { std::io::ErrorKind::Interrupted, std::io::ErrorKind::TimedOut, std::io::ErrorKind::WouldBlock, + std::io::ErrorKind::ConnectionRefused, + std::io::ErrorKind::ConnectionReset, + std::io::ErrorKind::AddrNotAvailable, + std::io::ErrorKind::NetworkUnreachable, + std::io::ErrorKind::HostUnreachable, ] { let err = std::io::Error::from(kind); assert!(is_transient_udp_error(&err));