Compare commits

..

3 commits

Author SHA1 Message Date
nexy7574
f09e1c075d fix(sync/v2): Room leaves being omitted incorrectly
Partially borrowed from 85a84f93c7
2025-08-31 09:16:53 -07:00
Jacob Taylor
8eb5f8466f process edus before pdus here, too 2025-08-31 09:16:53 -07:00
Jacob Taylor
9723753b5c pass and use transaction id to collect timing info 2025-08-31 09:16:52 -07:00

View file

@ -167,7 +167,7 @@ async fn handle(
.try_stream()
.broad_and_then(|(room_id, pdus): (_, Vec<_>)| {
let count = pdus.len();
handle_room(services, client, origin, started, room_id, pdus.into_iter(), count)
handle_room(services, client, origin, started, room_id, pdus.into_iter(), count, transaction_id)
.map_ok(Vec::into_iter)
.map_ok(IterStream::try_stream)
})
@ -180,7 +180,7 @@ async fn handle(
edus = pdu_start.saturating_duration_since(handle_start).as_micros(),
pdus = results_start.saturating_duration_since(pdu_start).as_micros(),
handle_room = handle_stop.saturating_duration_since(results_start).as_micros(),
id = ?transaction_id,
transaction_id = ?transaction_id,
"handled incoming transaction",
);
Ok(results)
@ -194,6 +194,7 @@ async fn handle_room(
room_id: OwnedRoomId,
pdus: impl Iterator<Item = Pdu> + Send,
count: usize,
transaction_id: &str,
) -> Result<Vec<(OwnedEventId, Result)>> {
let _room_lock = services
.rooms
@ -211,6 +212,7 @@ async fn handle_room(
trace!(
%room_id,
%event_id,
transaction_id = ?transaction_id,
pdu = n + 1,
total = count,
pdu_elapsed = ?pdu_start_time.elapsed(),
@ -227,11 +229,12 @@ async fn handle_room(
info!(
%room_id,
%event_id,
transaction_id = ?transaction_id,
pdu = n + 1,
total = count,
pdu_elapsed = ?pdu_start_time.elapsed(),
txn_elapsed = ?txn_start_time.elapsed(),
"Finished handling PDU {event_id}",
"Finished handling PDU",
);
n += 1;