mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 12:16:54 +00:00
feat: Make logging more verbose to diagnose the aranjesplosion
This commit is contained in:
1 parent
ad98dca8c2
commit
e76881d64a
5 files changed
+11
-4
No files matched your search
@@ -548,12 +548,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() {
|
||||
|
||||
@@ -226,13 +226,15 @@ impl super::Service {
|
||||
.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);
|
||||
}
|
||||
|
||||
@@ -247,10 +249,12 @@ impl super::Service {
|
||||
// 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
|
||||
|
||||
@@ -18,6 +18,7 @@ impl super::Service {
|
||||
/// Handles a PDU as an outlier, performing basic checks like signatures and
|
||||
/// hashes, proclaimed event auth, and then adding it to the outlier tree.
|
||||
#[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 @@ impl super::Service {
|
||||
Ok((event_id, value))
|
||||
}
|
||||
|
||||
#[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::{
|
||||
};
|
||||
|
||||
impl 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,
|
||||
|
||||
Reference in new issue
Block a user