fix(universaldb): report the last error when transaction retries are exhausted - #5695
Conversation
|
Stack for rivet-dev/actors
Get stack: change otvmloun |
|
🚅 Deployed to the actors-pr-5695 environment in rivet-frontend
|
| MaxRetriesReached, | ||
| // Stores the last error. The alternate format prints the whole context chain, so the cause the | ||
| // context names is reported alongside the underlying variant. | ||
| #[error("max number of transaction retries reached, last error: {0:#}")] |
There was a problem hiding this comment.
🟠 Medium · Preserve the last error in the error source chain
The tuple field is formatted into this error, but it is not marked as a thiserror source. Consequently anyhow::Error::chain() stops at MaxRetriesReached and callers cannot inspect or downcast the retry-exhausting TransactionTooOld, NotCommitted, or its contextual cause programmatically; only the rendered alternate display includes it.
Mark the wrapped anyhow::Error with #[source] (or use a named source field) so the reported cause remains part of the standard error chain.
|
Review: fix(universaldb): report the last error when transaction retries are exhausted Reviewed the diff ( Findings 1. The refactor silently changes total attempt counts and backoff pacing for the database-wide default limit (worth confirming intentional) To capture the last error, the retry-limit check moved from before running an attempt to after an attempt fails (
For the per-txn override path ( As a side effect, 2. No test actually asserts the fix core claim (the last error is preserved) Every updated test ( 3. Minor:
4. Note (not a blocker): The wrapped What looks good
No security concerns: this is all internal engine retry and error-reporting logic within the trusted UniversalDB driver boundary. 🤖 Generated with Claude Code |
487b538 to
c040647
Compare
| MaxRetriesReached, | ||
| // Stores the last error. The alternate format prints the whole context chain, so the cause the | ||
| // context names is reported alongside the underlying variant. | ||
| #[error("max number of transaction retries reached, last error: {0:#}")] |
There was a problem hiding this comment.
🟠 Medium · Preserve the last error in the error source chain
The tuple field is formatted into this error, but it is not marked as a thiserror source. Consequently anyhow::Error::chain() stops at MaxRetriesReached and callers cannot inspect or downcast the retry-exhausting TransactionTooOld, NotCommitted, or its contextual cause programmatically; only the rendered alternate display includes it.
Mark the wrapped anyhow::Error with #[source] (or use a named source field) so the reported cause remains part of the standard error chain.
c040647 to
fb5d946
Compare
| MaxRetriesReached, | ||
| // Stores the last error. The alternate format prints the whole context chain, so the cause the | ||
| // context names is reported alongside the underlying variant. | ||
| #[error("max number of transaction retries reached, last error: {0:#}")] |
There was a problem hiding this comment.
🟠 Medium · Preserve the last error in the error source chain
The tuple field is formatted into this error, but it is not marked as a thiserror source. Consequently anyhow::Error::chain() stops at MaxRetriesReached and callers cannot inspect or downcast the retry-exhausting TransactionTooOld, NotCommitted, or its contextual cause programmatically; only the rendered alternate display includes it.
Mark the wrapped anyhow::Error with #[source] (or use a named source field) so the reported cause remains part of the standard error chain.
No description provided.