diff --git a/src/admin/federation/commands.rs b/src/admin/federation/commands.rs index cb043653..58a1c2d1 100644 --- a/src/admin/federation/commands.rs +++ b/src/admin/federation/commands.rs @@ -30,12 +30,15 @@ pub(super) async fn incoming_federation(&self) -> Result { .federation_handletime .read(); - let mut msg = format!("Handling {} incoming pdus:\n", map.len()); + let mut msg = format!( + "Handling {} incoming PDUs across {} active transactions:\n", + map.len(), + self.services.transaction_ids.txn_active_handle_count() + ); for (r, (e, i)) in map.iter() { let elapsed = i.elapsed(); writeln!(msg, "{} {}: {}m{}s", r, e, elapsed.as_secs() / 60, elapsed.as_secs() % 60)?; } - msg }; diff --git a/src/api/server/send.rs b/src/api/server/send.rs index a1687d41..0199e80f 100644 --- a/src/api/server/send.rs +++ b/src/api/server/send.rs @@ -158,6 +158,8 @@ async fn process_inbound_transaction( // value, returning an empty response may lie to the remote and make them // think we processed it properly (and lose events), but we also can't return // an actual error. + drop(sender); + services.transaction_ids.finish_federation_txn(&txn_key); panic!("failed to handle incoming transaction"); }; diff --git a/src/service/transaction_ids/mod.rs b/src/service/transaction_ids/mod.rs index e9639064..09487580 100644 --- a/src/service/transaction_ids/mod.rs +++ b/src/service/transaction_ids/mod.rs @@ -52,6 +52,13 @@ impl crate::Service for Service { } impl Service { + + #[must_use] + pub fn txn_active_handle_count(&self) -> usize { + let state = self.servername_txnid_active.read(); + state.len() + } + pub fn add_client_txnid( &self, user_id: &UserId,