Skip to content

Commit

Permalink
chore(transport): Ignore TCP_USER_TIMEOUT on non-Linux systems and wa…
Browse files Browse the repository at this point in the history
…rn (#3628)

Signed-off-by: Zahari Dichev <[email protected]>
  • Loading branch information
zaharidichev authored Feb 21, 2025
1 parent fc4efc9 commit 46ea686
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions linkerd/proxy/transport/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ fn set_keepalive_or_warn(
tokio::net::TcpStream::from_std(stream)
}

#[cfg(target_os = "linux")]
fn set_user_timeout_or_warn(
tcp: TcpStream,
user_timeout: Option<Duration>,
Expand All @@ -85,3 +86,14 @@ fn set_user_timeout_or_warn(
let stream: std::net::TcpStream = socket2::Socket::into(sock);
tokio::net::TcpStream::from_std(stream)
}

#[cfg(not(target_os = "linux"))]
fn set_user_timeout_or_warn(
tcp: TcpStream,
user_timeout: Option<Duration>,
) -> io::Result<TcpStream> {
if user_timeout.is_some() {
tracing::debug!("TCP_USER_TIMEOUT is supported on Linux only.");
}
Ok(tcp)
}

0 comments on commit 46ea686

Please sign in to comment.