-
Notifications
You must be signed in to change notification settings - Fork 403
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
Conversation
@Hoverbear awesome, have you had success using this repo for some 'rafting' yet? |
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. |
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 |
@stephanbuys This is one of my goals for the next few months. :) I'd like to get this |
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
5f7c4bd
to
ce7cdbc
Compare
ce7cdbc
to
02d0584
Compare
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.
02d0584
to
b26e90f
Compare
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. |
Signed-off-by: qupeng <[email protected]>
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