From 470612bdfb41471a60920002b9762853bf993716 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Fri, 4 Sep 2026 22:46:49 +0800 Subject: [PATCH] log: quiet the two webrtc-rs sites that report the race's normal outcome Racing WebRTC against UDP and TCP means one transport is cancelled on every session that connects, and cancelling it walks agent_internal's candidate list closing sockets that are already gone - one warn per candidate, plus the peer_connection cascade behind it (ice cancelled by caller, SCTP without DTLS, the SRTP sessions never opened). Trickle adds pingAllCandidates on every check tick until the first pair arrives. None of it is a fault, and all of it lands beside a connection that succeeded, where it reads as one: 90 of 386 lines in a controlled-side log spent saying the design worked. agent_gather stays at warn. A STUN server it could not reach is the one thing upstream says that explains a session which never connected, and it is a different module from the noise, so the two separate cleanly. Errors in the quieted modules still print, and RUST_LOG overrides the whole spec for anyone who wants the warns back. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01M54JAqUK4RynudFou89hod --- src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 44b8cba5c..5ee3d816c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -430,10 +430,15 @@ pub fn init_log(_is_async: bool, _name: &str) -> Option = None; INIT.call_once(|| { + // webrtc-rs reports the racing design's normal outcome at warn: cancelling the transport + // that lost closes every gathered candidate one line at a time, and trickle means the + // agent always checks before it holds a pair. Both read as faults beside a connection + // that succeeded. agent_gather keeps its warn level - a STUN server it could not reach + // is the one upstream signal that explains a session which never connected. #[cfg(debug_assertions)] { use env_logger::*; - init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info,reqwest=warn,rustls=warn,webrtc-sctp=warn,webrtc=warn")); + init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info,reqwest=warn,rustls=warn,webrtc-sctp=warn,webrtc=warn,webrtc_ice::agent::agent_internal=error,webrtc::peer_connection=error")); } #[cfg(not(debug_assertions))] { @@ -448,7 +453,7 @@ pub fn init_log(_is_async: bool, _name: &str) -> Option