Skip to content

Properly preserve full error chain, when handle_committed_entries returns an error - #5095

Merged
ffuugoo merged 1 commit into
devfrom
consensus-thread-preserve-error-chain
Sep 17, 2024
Merged

ffuugoo merged 1 commit into
devfrom
consensus-thread-preserve-error-chain

Conversation

@ffuugoo

@ffuugoo ffuugoo commented Sep 17, 2024

Copy link
Copy Markdown
Contributor

Continuation of #5066.

As it turned out, we made some "lossy" error conversions in consensus module, and so at the point where we were logging consensus error, the error did not contain the cause of the error.

This PR fixes error conversions, so that we preserve error cause.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?

@KShivendu KShivendu left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. But I see many other occurences of mapping err into anyhow! like this without using context().

Just search for anyhow! in the code and cross check if you are missing something related to consensus.

@timvisee

Copy link
Copy Markdown
Member

Just search for anyhow! in the code and cross check if you are missing something related to consensus.

anyhow! is normally used to convert a non-anyhow error into an anyhow error. context() adds context (wraps) to an anyhow error.

@ffuugoo
ffuugoo merged commit 711a7a7 into dev Sep 17, 2024
@ffuugoo
ffuugoo deleted the consensus-thread-preserve-error-chain branch September 17, 2024 09:52
timvisee pushed a commit that referenced this pull request Sep 17, 2024
@leohenon leohenon mentioned this pull request Feb 17, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants