From 59cbce50f7fb6ba079c3ffae33564847416b6f6d Mon Sep 17 00:00:00 2001 From: mfahampshire Date: Fri, 7 Nov 2025 20:24:08 +0000 Subject: [PATCH] mod logging to with poisoning retry --- mixtcp/examples/cloudflare_ping.rs | 12 +++++++----- mixtcp/examples/https_client.rs | 12 +++++++----- mixtcp/examples/tls.rs | 12 +++++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/mixtcp/examples/cloudflare_ping.rs b/mixtcp/examples/cloudflare_ping.rs index 9200969a1a..2c1d79f2b8 100644 --- a/mixtcp/examples/cloudflare_ping.rs +++ b/mixtcp/examples/cloudflare_ping.rs @@ -129,11 +129,13 @@ fn inspect_tls_packet(data: &[u8]) { } fn init_logging() { - if tracing::dispatcher::has_been_set() { - return; - } - INIT.call_once(|| { - nym_bin_common::logging::setup_tracing_logger(); + INIT.call_once_force(|state| { + if state.is_poisoned() { + eprintln!("Logger initialization was poisoned, retrying"); + } + if !tracing::dispatcher::has_been_set() { + nym_bin_common::logging::setup_tracing_logger(); + } }); } diff --git a/mixtcp/examples/https_client.rs b/mixtcp/examples/https_client.rs index 27d3a180aa..c49f83f180 100644 --- a/mixtcp/examples/https_client.rs +++ b/mixtcp/examples/https_client.rs @@ -274,11 +274,13 @@ impl MixtcpResponse { } fn init_logging() { - if tracing::dispatcher::has_been_set() { - return; - } - INIT.call_once(|| { - nym_bin_common::logging::setup_tracing_logger(); + INIT.call_once_force(|state| { + if state.is_poisoned() { + eprintln!("Logger initialization was poisoned, retrying"); + } + if !tracing::dispatcher::has_been_set() { + nym_bin_common::logging::setup_tracing_logger(); + } }); } diff --git a/mixtcp/examples/tls.rs b/mixtcp/examples/tls.rs index 17502a8ed7..749e9ecc14 100644 --- a/mixtcp/examples/tls.rs +++ b/mixtcp/examples/tls.rs @@ -130,11 +130,13 @@ fn inspect_tls_packet(data: &[u8]) { } fn init_logging() { - if tracing::dispatcher::has_been_set() { - return; - } - INIT.call_once(|| { - nym_bin_common::logging::setup_tracing_logger(); + INIT.call_once_force(|state| { + if state.is_poisoned() { + eprintln!("Logger initialization was poisoned, retrying"); + } + if !tracing::dispatcher::has_been_set() { + nym_bin_common::logging::setup_tracing_logger(); + } }); }