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.
ReviewReviewed the diff for Likely bug: retry-loop refactor changes attempt count and backoff timing (unrelated to the stated fix)In both
Neither behavior is mentioned in the commit message, and neither is covered by an existing test: Other notes
Nothing else stood out; the rest of the diff (error type change, call-site updates) is mechanical and consistent. 🤖 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.
No description provided.