feat: Make logging more verbose to diagnose the aranjesplosion

This commit is contained in:
timedout committed 2026-06-20 17:08:00 +01:00
1 parent f34f84832b
commit 2a598af888
5 files changed
+11 -4

No files matched your search

@@ -224,12 +224,12 @@ impl super::Service {
if pdu.depth < min_depth {
debug_warn!(
elapsed=?start.elapsed(),"Received PDU with depth {} below min_depth {}, ignoring",
elapsed=?start.elapsed(),"Received PDU with depth {} below min_depth {}",
pdu.depth,
min_depth
);
discovered.insert(event_id.clone(), pdu);
continue;
// discovered.insert(event_id.clone(), pdu);
// continue;
}
for prev_event_id in pdu.prev_events() {
@@ -221,13 +221,15 @@ pub async fn handle_incoming_pdu<'a>(
.remove(room_id);
}};
info!("[TODO] Handling PDU as outlier");
let (incoming_pdu, val) = self
.handle_outlier_pdu(origin, create_event, event_id, room_id, value, false)
.await
.inspect_err(|e| error!("[TODO] Failed to handle outlier PDU: {e:?}"))?;
info!("[TODO] Finished handling PDU as outlier");
// 8. if not timeline event: stop
if !is_timeline_event {
info!("[TODO] Not upgrading PDU");
return Ok(None);
}
@@ -242,10 +244,12 @@ pub async fn handle_incoming_pdu<'a>(
// 9. Fetch any missing prev events doing all checks listed here starting at 1.
// These are timeline events
info!("[TODO] Fetching prev events");
self.fetch_prevs(room_id, create_event, &incoming_pdu, origin)
.await
.inspect_err(|e| error!("[TODO] Failed to fetch_prevs: {e:?}"))?;
info!("[TODO] Finished fetching prev events, attempting to upgrade");
// Done with prev events, now handling the incoming event
self.upgrade_outlier_to_timeline_pdu(incoming_pdu, val, create_event, origin, room_id)
.await
@@ -16,6 +16,7 @@ use crate::rooms::timeline::pdu_fits;
#[implement(super::Service)]
#[allow(clippy::too_many_arguments)]
#[tracing::instrument(name="handle_outlier", skip_all, fields(%event_id))]
pub(super) async fn handle_outlier_pdu<'a, Pdu>(
&self,
origin: &'a ServerName,
@@ -118,6 +118,7 @@ pub async fn parse_incoming_pdu_with_known_room(
}
#[implement(super::Service)]
#[tracing::instrument(name = "parse", skip_all)]
pub async fn parse_incoming_pdu(&self, pdu: &RawJsonValue) -> Result<Parsed> {
let value = serde_json::from_str::<CanonicalJsonObject>(pdu.get()).map_err(|e| {
err!(BadServerResponse(debug_warn!("Error parsing incoming event {e:?}")))
@@ -24,6 +24,7 @@ use crate::rooms::{
};
#[implement(super::Service)]
#[tracing::instrument(name="upgrade_outlier", skip_all, fields(event_id=%incoming_pdu.event_id()))]
pub(super) async fn upgrade_outlier_to_timeline_pdu(
&self,
incoming_pdu: PduEvent,