Repository navigation
Conversation
A fatal store error reached the operator as `Failed to transact block
operations` alone. `detail()` wraps the cause in an `anyhow::Error`, and
`ProcessingError::Deterministic` rendered it with `{0}`; the runner then
formats the whole enum with `{:#}` for persistence, so `anyhow`'s
alternate formatting stopped at the display message instead of walking
into the source chain. The diagnostic that identifies the store problem,
such as `synthetic constraint violation`, was discarded before it was
written.
The variant now renders with `{0:#}`. Those `Display` impls that ignore
the alternate are unaffected, and `StoreError::Unknown` already formats
its cause that way.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A fatal store error reaches the operator as
Failed to transact block operationswith no indication of what failed. The persisted message should carry both the transaction context and the original cause.Why
ProcessingError::detailwraps a deterministic error's cause in ananyhow::Error:The runner then formats the whole enum with
{:#}before persisting it (runner/mod.rs). The variant's renderer was#[error("{0}")], which hands the wrapper toFormatter::Displayrather thanFormatter::Debug-style alternates, so the output ends atanyhow's outermost message and never walks into the source chain.StoreError::Unknownalready formats its cause with{0:#}, so this brings the deterministic variant in line with the rest of the error types.Change
#[error("{0}")]→#[error("{0:#}")]onProcessingError::Deterministic.Displayimpls that ignore the alternate flag are unaffected. That coversSubgraphErrorand theStoreErrorvariants that write a fixed message.Test
a_deterministic_error_keeps_its_cause_under_the_contextbuilds a deterministic error with a synthetic store cause, runs it throughdetail(), and asserts the{:#}rendering contains both halves:Before the change it fails with
left: "Failed to transact block operations". After it, it passes.cargo test -p graph-core --lib subgraph::— 7 passed.cargo test -p graph-core --lib— 13 passed, 1 failed. The failure ispolling_monitor::ipfs_service::test::cat_file_in_folder, which needs a live IPFS service and fails the same way on an untouched checkout.cargo fmt -p graph-core --checkclean,cargo clippy -p graph-core --libhas no warning for the changed file.Closes #6791