From 7fa5a778aacc5233a3082602c4e23d7b704e8482 Mon Sep 17 00:00:00 2001 From: Floriane TUERNAL SABOTINOV Date: Wed, 27 Aug 2025 14:12:15 +0200 Subject: [PATCH] test lifetime span into tokio select --- common/bin-common/src/logging/mod.rs | 2 +- .../websocket/connection_handler/authenticated.rs | 1 - .../websocket/connection_handler/fresh.rs | 9 ++++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/bin-common/src/logging/mod.rs b/common/bin-common/src/logging/mod.rs index b5a9c68e40..0725ef9a5e 100644 --- a/common/bin-common/src/logging/mod.rs +++ b/common/bin-common/src/logging/mod.rs @@ -38,7 +38,7 @@ pub fn default_tracing_env_filter() -> tracing_subscriber::filter::EnvFilter { } else { // if the env value was not found, default to `INFO` level rather than `ERROR` tracing_subscriber::filter::EnvFilter::builder() - .with_default_directive(tracing_subscriber::filter::LevelFilter::INFO.into()) + .with_default_directive(tracing_subscriber::filter::LevelFilter::DEBUG.into()) .parse_lossy("") } } diff --git a/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs b/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs index e4c3c51117..b532469b0e 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs @@ -520,7 +520,6 @@ impl AuthenticatedHandler { // apparently tungstenite auto-handles ping/pong/close messages so for now let's ignore // them and let's test that claim. If that's not the case, just copy code from // desktop nym-client websocket as I've manually handled everything there - tracing::debug!("[TEST TEST] Do I appear here? handle_request"); match raw_request { Message::Binary(bin_msg) => Some(self.handle_binary(bin_msg).await), Message::Text(text_msg) => Some(self.handle_text(text_msg).await), diff --git a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs index 450376bffd..4b8415e505 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs @@ -1015,12 +1015,19 @@ impl FreshHandler { R: CryptoRng + RngCore + Send, { while !shutdown.is_shutdown() { + let current_span = tracing::Span::current(); let req = tokio::select! { biased; _ = shutdown.recv() => { + let _shutdown_span = tracing::span!(parent: current_span, tracing::Level::DEBUG, "shutdown"); + let _span_guard = _shutdown_span.enter(); return None }, - req = self.wait_for_initial_message() => req, + req = self.wait_for_initial_message() => { + let _msg_span = tracing::span!(parent: current_span, tracing::Level::DEBUG, "initial_message"); + let _span_guard = _msg_span.enter(); + req + }, }; let initial_request = match req {