From a407909d09f09c6fe0f714a8ab6ae872c0b8ef6a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 24 Dec 2024 01:07:53 +0000 Subject: [PATCH] reduce unnecessary info-level spans to debug Signed-off-by: Jason Volk --- src/core/utils/sys/compute.rs | 2 +- src/service/resolver/actual.rs | 4 ++-- src/service/rooms/timeline/mod.rs | 6 +++--- src/service/sending/mod.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/utils/sys/compute.rs b/src/core/utils/sys/compute.rs index 4e9ef743..e947b579 100644 --- a/src/core/utils/sys/compute.rs +++ b/src/core/utils/sys/compute.rs @@ -10,7 +10,7 @@ static CORES_AVAILABLE: LazyLock = LazyLock::new(|| { .unwrap_or_default() .into_iter() .map(|core_id| core_id.id) - .inspect(|&id| assert!(id < 128, "Core ID must be < 128 at least for now")) + .inspect(|&id| debug_assert!(id < 128, "Core ID must be < 128 at least for now")) .fold(0_u128, |mask, id| mask | (1 << id)) }); diff --git a/src/service/resolver/actual.rs b/src/service/resolver/actual.rs index 0506be2c..f8bc0f6a 100644 --- a/src/service/resolver/actual.rs +++ b/src/service/resolver/actual.rs @@ -45,7 +45,7 @@ impl super::Service { /// Implemented according to the specification at /// Numbers in comments below refer to bullet points in linked section of /// specification - #[tracing::instrument(skip_all, name = "actual")] + #[tracing::instrument(skip(self, cache), name = "actual")] pub async fn resolve_actual_dest( &self, dest: &ServerName, @@ -298,7 +298,7 @@ impl super::Service { } } - #[tracing::instrument(skip_all, name = "ip")] + #[tracing::instrument(skip(self, overname, port), name = "ip")] async fn query_and_cache_override( &self, overname: &'_ str, diff --git a/src/service/rooms/timeline/mod.rs b/src/service/rooms/timeline/mod.rs index 028b270f..3b81e2e5 100644 --- a/src/service/rooms/timeline/mod.rs +++ b/src/service/rooms/timeline/mod.rs @@ -859,7 +859,7 @@ impl Service { /// Creates a new persisted data unit and adds it to a room. This function /// takes a roomid_mutex_state, meaning that only this function is able to /// mutate the room state. - #[tracing::instrument(skip(self, state_lock))] + #[tracing::instrument(skip(self, state_lock), level = "debug")] pub async fn build_and_append_pdu( &self, pdu_builder: PduBuilder, @@ -1082,7 +1082,7 @@ impl Service { self.replace_pdu(&pdu_id, &obj, &pdu).await } - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "debug")] pub async fn backfill_if_required(&self, room_id: &RoomId, from: PduCount) -> Result<()> { if self .services @@ -1194,7 +1194,7 @@ impl Service { Ok(()) } - #[tracing::instrument(skip(self, pdu))] + #[tracing::instrument(skip(self, pdu), level = "debug")] pub async fn backfill_pdu(&self, origin: &ServerName, pdu: Box) -> Result<()> { let (event_id, value, room_id) = self.services.event_handler.parse_incoming_pdu(&pdu).await?; diff --git a/src/service/sending/mod.rs b/src/service/sending/mod.rs index 5ccba249..e52bfb25 100644 --- a/src/service/sending/mod.rs +++ b/src/service/sending/mod.rs @@ -277,7 +277,7 @@ impl Service { } /// Sends a request to a federation server - #[tracing::instrument(skip_all, name = "request")] + #[tracing::instrument(skip_all, name = "request", level = "debug")] pub async fn send_federation_request( &self, dest: &ServerName, @@ -291,7 +291,7 @@ impl Service { } /// Like send_federation_request() but with a very large timeout - #[tracing::instrument(skip_all, name = "synapse")] + #[tracing::instrument(skip_all, name = "synapse", level = "debug")] pub async fn send_synapse_request( &self, dest: &ServerName,