From 4e67c568da79219e644a01eeccf34e11583f9031 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 11 Nov 2024 19:51:10 +0000 Subject: [PATCH] refactor: downgrade errors when we cannot bind sockets (#7305) Most of the time, these errors are a result of a limited IP stack, for example IPv6 not being available. Reporting these as errors to Sentry is unnecessarily noisy. If something else happens further down the line, the last 500 debug and info logs will be sent along with the error report so we will still see these in the breadcrumbs if an actual error happens later. Resolves: #7245. --- rust/connlib/tunnel/src/sockets.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rust/connlib/tunnel/src/sockets.rs b/rust/connlib/tunnel/src/sockets.rs index 8560df002..82b34dcd2 100644 --- a/rust/connlib/tunnel/src/sockets.rs +++ b/rust/connlib/tunnel/src/sockets.rs @@ -1,4 +1,3 @@ -use firezone_logging::std_dyn_err; use socket_factory::{DatagramIn, DatagramOut, SocketFactory, UdpSocket}; use std::{ io, @@ -20,10 +19,10 @@ pub(crate) struct Sockets { impl Sockets { pub fn rebind(&mut self, socket_factory: &dyn SocketFactory) { self.socket_v4 = socket_factory(&SocketAddr::V4(UNSPECIFIED_V4_SOCKET)) - .inspect_err(|e| tracing::warn!(error = std_dyn_err(e), "Failed to bind IPv4 socket")) + .inspect_err(|e| tracing::info!("Failed to bind IPv4 socket: {e}")) .ok(); self.socket_v6 = socket_factory(&SocketAddr::V6(UNSPECIFIED_V6_SOCKET)) - .inspect_err(|e| tracing::warn!(error = std_dyn_err(e), "Failed to bind IPv6 socket")) + .inspect_err(|e| tracing::info!("Failed to bind IPv6 socket: {e}")) .ok(); if let Some(waker) = self.waker.take() {