Compare commits

..

5 commits

Author SHA1 Message Date
Jacob Taylor
60b8c9f5f2 turns out we need debug_warn 2025-08-26 18:42:40 -07:00
Jacob Taylor
c83f1ddb71 add event_id to log entry 2025-08-26 18:39:37 -07:00
Jacob Taylor
a75eacd544 reduce log volume (keeps 2 infos)
adjust log volume

demote a bunch of logs
2025-08-26 18:39:37 -07:00
Jacob Taylor
e15d71d230 log which room is being backfilled
move more backfill log to info, clean up imports
2025-08-26 18:38:49 -07:00
Jacob Taylor
a7929c1931 fix warn by removing unused debug imports
delete more imports to quiet cargo
2025-08-26 18:36:39 -07:00

View file

@ -3,11 +3,7 @@ use std::{
time::Instant, time::Instant,
}; };
use conduwuit::{ use conduwuit::{Event, PduEvent, debug, debug_error, implement, matrix::event::gen_event_id_canonical_json, trace, utils::continue_exponential_backoff_secs, warn, debug_warn};
Event, PduEvent, debug, debug_error, implement,
matrix::event::gen_event_id_canonical_json, trace, utils::continue_exponential_backoff_secs,
warn,
};
use ruma::{ use ruma::{
CanonicalJsonValue, EventId, OwnedEventId, RoomId, ServerName, CanonicalJsonValue, EventId, OwnedEventId, RoomId, ServerName,
api::federation::event::get_event, api::federation::event::get_event,
@ -70,6 +66,30 @@ where
let mut events_all = HashSet::with_capacity(todo_auth_events.len()); let mut events_all = HashSet::with_capacity(todo_auth_events.len());
while let Some(next_id) = todo_auth_events.pop_front() { while let Some(next_id) = todo_auth_events.pop_front() {
if let Some((time, tries)) = self
.services
.globals
.bad_event_ratelimiter
.read()
.get(&*next_id)
{
// Exponential backoff
const MIN_DURATION: u64 = 60 * 2;
const MAX_DURATION: u64 = 60 * 60;
if continue_exponential_backoff_secs(
MIN_DURATION,
MAX_DURATION,
time.elapsed(),
*tries,
) {
debug_warn!(
tried = ?*tries,
elapsed = ?time.elapsed(),
"Backing off from {next_id}",
);
continue;
}
}
if events_all.contains(&next_id) { if events_all.contains(&next_id) {
continue; continue;