Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Introduce Failure. #2

Closed
wants to merge 4 commits into from

Conversation

Hoverbear
Copy link
Contributor

WIP: Please note I haven't fully groomed this PR and I'd like to place some effort in writing a proper ticket for it. Feel free to provide feedback at this point though.


Prior to this change, we used quick_error.

This change introduces Failure in the Error & ErrorKind strategy.

For more information on this style: https://boats.gitlab.io/failure/error-errorkind.html

@stephanbuys
Copy link

@Hoverbear awesome, have you had success using this repo for some 'rafting' yet?

@siddontang
Copy link
Contributor

Hi @stephanbuys

This repo is the same as current TiKV's, so I think we can use it directly in production. But now we miss examples and documents to let the user use it easily.

@Hoverbear will help us first improve the error handling with introducing failure, then use this raft library in TiKV.

@stephanbuys
Copy link

This is great, I will keep my eye on the repo and start trying it out as soon as the first basic examples start working

@Hoverbear
Copy link
Contributor Author

@stephanbuys This is one of my goals for the next few months. :) I'd like to get this raft-rs in a state where I can start pointing people looking at https://github.com/Hoverbear/raft-rs/ here. =D

Prior to this change, we used quick_error.

This change introduces Failure in the Error & ErrorKind strategy.

For more information on this style: https://boats.gitlab.io/failure/error-errorkind.html
This commit reduces the size of a `Result<(), RaftError>` from 56 to 8
byes by boxing the `Context<T>` contained. This means errors are a heap
allocation, but it also means that `Result` have a considerably smaller
minimum size.

In cases where we return data in the `Ok` variant of the `Result` this
will result in slightly worse in the error path, but should not impact
the performance of the happy path.
@Hoverbear
Copy link
Contributor Author

I'm going to close this but we still intend to move to failure at some point in the future. There is a new version and this PR is quite stale.

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.

3 participants