From ee38ccc120a5bff18f5de958b0390a087162a125 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 12 Nov 2025 14:37:39 +1100 Subject: [PATCH] chore(connlib): log index of failed connections (#10866) Logging the peer index of a failed connection makes it easier to correlate it with logs when we receive packets for an unknown connection. --- rust/connlib/snownet/src/node.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/connlib/snownet/src/node.rs b/rust/connlib/snownet/src/node.rs index b25193538..2206ef4e7 100644 --- a/rust/connlib/snownet/src/node.rs +++ b/rust/connlib/snownet/src/node.rs @@ -1861,7 +1861,7 @@ where .candidate_timeout() .is_some_and(|timeout| now >= timeout) { - tracing::info!(state = %self.state, "Connection failed (no candidates received)"); + tracing::info!(state = %self.state, index = %self.index.global(), "Connection failed (no candidates received)"); self.state = ConnectionState::Failed; return; } @@ -1870,7 +1870,7 @@ where .disconnect_timeout() .is_some_and(|timeout| now >= timeout) { - tracing::info!(state = %self.state, "Connection failed (ICE timeout)"); + tracing::info!(state = %self.state, index = %self.index.global(), "Connection failed (ICE timeout)"); self.state = ConnectionState::Failed; return; } @@ -2102,7 +2102,7 @@ where match self.tunnel.update_timers_at(&mut buf, now) { TunnResult::Done => {} TunnResult::Err(WireGuardError::ConnectionExpired) => { - tracing::info!(state = %self.state, "Connection failed (wireguard tunnel expired)"); + tracing::info!(state = %self.state, index = %self.index.global(), "Connection failed (wireguard tunnel expired)"); self.state = ConnectionState::Failed; } TunnResult::Err(e) => {