mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 05:06:53 +00:00
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:
1 parent
3c07f46451
commit
2dc6051d67
2 files changed
+24
-3
No files matched your search
@@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user