Treat more network churn errors as transient
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s

This commit is contained in:
DuProcess
2026-07-16 22:15:22 -04:00
parent 1ca8a2e3ce
commit dba598a7fa
2 changed files with 24 additions and 2 deletions
+15
View File
@@ -13766,6 +13766,12 @@ mod tests {
assert!(is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(libc::EADDRNOTAVAIL)
));
assert!(is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(libc::ENOBUFS)
));
assert!(is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(libc::ECONNABORTED)
));
assert!(!is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(libc::EINVAL)
));
@@ -13773,6 +13779,9 @@ mod tests {
#[cfg(windows)]
{
assert!(is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(10035)
)); // WSAEWOULDBLOCK
assert!(is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(10051)
)); // WSAENETUNREACH
@@ -13782,6 +13791,12 @@ mod tests {
assert!(is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(10049)
)); // WSAEADDRNOTAVAIL
assert!(is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(10053)
)); // WSAECONNABORTED
assert!(is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(10055)
)); // WSAENOBUFS
assert!(!is_transient_udp_send_error(
&std::io::Error::from_raw_os_error(10022)
)); // WSAEINVAL
+9 -2
View File
@@ -86,10 +86,12 @@ fn is_transient_udp_os_error(code: i32) -> bool {
matches!(
code,
libc::EADDRNOTAVAIL
| libc::ECONNABORTED
| libc::ECONNREFUSED
| libc::ECONNRESET
| libc::EHOSTDOWN
| libc::EHOSTUNREACH
| libc::ENOBUFS
| libc::ENETDOWN
| libc::ENETRESET
| libc::ENETUNREACH
@@ -101,11 +103,14 @@ fn is_transient_udp_os_error(code: i32) -> bool {
fn is_transient_udp_os_error(code: i32) -> bool {
matches!(
code,
10049 // WSAEADDRNOTAVAIL
10035 // WSAEWOULDBLOCK
| 10049 // WSAEADDRNOTAVAIL
| 10050 // WSAENETDOWN
| 10051 // WSAENETUNREACH
| 10052 // WSAENETRESET
| 10053 // WSAECONNABORTED
| 10054 // WSAECONNRESET
| 10055 // WSAENOBUFS
| 10060 // WSAETIMEDOUT
| 10061 // WSAECONNREFUSED
| 10064 // WSAEHOSTDOWN
@@ -195,10 +200,12 @@ mod tests {
fn classifies_unix_network_churn_as_transient() {
for code in [
libc::EADDRNOTAVAIL,
libc::ECONNABORTED,
libc::ECONNREFUSED,
libc::ECONNRESET,
libc::EHOSTDOWN,
libc::EHOSTUNREACH,
libc::ENOBUFS,
libc::ENETDOWN,
libc::ENETRESET,
libc::ENETUNREACH,
@@ -214,7 +221,7 @@ mod tests {
#[test]
fn classifies_windows_network_churn_as_transient() {
for code in [
10049, 10050, 10051, 10052, 10054, 10060, 10061, 10064, 10065,
10035, 10049, 10050, 10051, 10052, 10053, 10054, 10055, 10060, 10061, 10064, 10065,
] {
let err = std::io::Error::from_raw_os_error(code);
assert!(is_transient_udp_error(&err));