fix(federation): Make transactions infallible

Previously, a transaction panicking in the handle() call would cause the
transaction to be indefinitely logged as "running" in the transaction
handler. This means subsequent transactions from the sending server
would be met with the "You're still sending me a txn!" 429 response,
forever, effectively causing defederation between the two servers, until
continuwuity is fully restarted.

I could just fix the known panics in the handle function and internal
calls, however there's so many subsystems that could reasonably panic
that it is just better to have a safer approach and ensure that the
handle call is infallible.
This commit is contained in:
timedout authored and Ellis Git committed 2026-08-15 16:10:39 +00:00
1 parent 3c07f46451
commit 2dc6051d67
2 files changed
+24 -3

No files matched your search

+2
View File
@@ -32,12 +32,14 @@ pub enum TransactionError {
/// Server is shutting down - the sender should retry the entire
/// transaction.
ShuttingDown,
Unexpected,
}
impl fmt::Display for TransactionError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
| Self::ShuttingDown => write!(f, "Server is shutting down"),
| Self::Unexpected => write!(f, "Fatal Internal Server Error"),
}
}
}