From c264d6fbbe40af6eedc333d560613f0593f6e8ea Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Wed, 3 Jul 2024 21:28:16 -0400 Subject: [PATCH] cleanup --- veilid-core/src/network_manager/connection_handle.rs | 4 ++-- veilid-core/src/network_manager/connection_manager.rs | 5 ++--- veilid-core/src/network_manager/mod.rs | 2 ++ veilid-core/src/network_manager/network_connection.rs | 7 +++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/veilid-core/src/network_manager/connection_handle.rs b/veilid-core/src/network_manager/connection_handle.rs index 119e1535..c5606360 100644 --- a/veilid-core/src/network_manager/connection_handle.rs +++ b/veilid-core/src/network_manager/connection_handle.rs @@ -43,7 +43,7 @@ impl ConnectionHandle { } } - // #[cfg_attr(feature="verbose-tracing", instrument(level="trace", skip(self, message), fields(message.len = message.len())))] + // #[instrument(level="trace", target="net", skip(self, message), fields(message.len = message.len()))] // pub fn send(&self, message: Vec) -> ConnectionHandleSendResult { // match self.channel.send((Span::current().id(), message)) { // Ok(()) => ConnectionHandleSendResult::Sent, @@ -51,7 +51,7 @@ impl ConnectionHandle { // } // } - #[cfg_attr(feature="verbose-tracing", instrument(level="trace", skip(self, message), fields(message.len = message.len())))] + #[instrument(level="trace", target="net", skip(self, message), fields(message.len = message.len()))] pub async fn send_async(&self, message: Vec) -> ConnectionHandleSendResult { match self .channel diff --git a/veilid-core/src/network_manager/connection_manager.rs b/veilid-core/src/network_manager/connection_manager.rs index ac9ef624..a053b0de 100644 --- a/veilid-core/src/network_manager/connection_manager.rs +++ b/veilid-core/src/network_manager/connection_manager.rs @@ -9,6 +9,7 @@ use stop_token::future::FutureExt; #[derive(Debug)] enum ConnectionManagerEvent { + #[cfg_attr(target_arch = "wasm32", allow(dead_code))] Accepted(ProtocolNetworkConnection), Dead(NetworkConnection), } @@ -420,7 +421,6 @@ impl ConnectionManager { } } - //#[instrument(level = "trace", skip_all)] async fn async_processor( self, stop_token: StopToken, @@ -438,7 +438,7 @@ impl ConnectionManager { // Called by low-level network when any connection-oriented protocol connection appears // either from incoming connections. - //#[cfg_attr(target_arch = "wasm32", allow(dead_code))] + #[cfg_attr(target_arch = "wasm32", allow(dead_code))] pub(super) async fn on_accepted_protocol_network_connection( &self, protocol_connection: ProtocolNetworkConnection, @@ -465,7 +465,6 @@ impl ConnectionManager { // Callback from network connection receive loop when it exits // cleans up the entry in the connection table - #[instrument(level = "trace", skip(self))] pub(super) async fn report_connection_finished(&self, connection_id: NetworkConnectionId) { // Get channel sender let sender = { diff --git a/veilid-core/src/network_manager/mod.rs b/veilid-core/src/network_manager/mod.rs index 76e62906..fd46ebf7 100644 --- a/veilid-core/src/network_manager/mod.rs +++ b/veilid-core/src/network_manager/mod.rs @@ -69,8 +69,10 @@ pub struct ProtocolConfig { pub outbound: ProtocolTypeSet, pub inbound: ProtocolTypeSet, pub family_global: AddressTypeSet, + #[cfg_attr(target_arch = "wasm32", allow(dead_code))] pub family_local: AddressTypeSet, pub public_internet_capabilities: Vec, + #[cfg_attr(target_arch = "wasm32", allow(dead_code))] pub local_network_capabilities: Vec, } diff --git a/veilid-core/src/network_manager/network_connection.rs b/veilid-core/src/network_manager/network_connection.rs index d798de62..4b10c3ea 100644 --- a/veilid-core/src/network_manager/network_connection.rs +++ b/veilid-core/src/network_manager/network_connection.rs @@ -307,7 +307,10 @@ impl NetworkConnection { need_sender = false; let sender_fut = receiver.recv_async().then(|res| async { match res { - Ok((_span_id, message)) => { + Ok((span_id, message)) => { + + let span = span!(parent: span_id, Level::TRACE, "process_connection send"); + let _enter = span.enter(); // Touch the LRU for this connection connection_manager.touch_connection_by_id(connection_id); @@ -317,7 +320,7 @@ impl NetworkConnection { &protocol_connection, stats.clone(), message, - ).in_current_span() + ) .await { // Sending the packet along can fail, if so, this connection is dead