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

Insert Learner/Voter should not panic. #88

Closed
Hoverbear opened this issue Jul 9, 2018 · 1 comment
Closed

Insert Learner/Voter should not panic. #88

Hoverbear opened this issue Jul 9, 2018 · 1 comment
Labels
Enhancement An improvement to existing code. Good First Issue A good issue for a new contributor.

Comments

@Hoverbear
Copy link
Contributor

Currently these two functions have no return, yet they panic on an otherwise reasonable mistake which could be handled by application code.

https://github.com/pingcap/raft-rs/blob/1e0741a9aea3b242d33dadc46245ad611e7e7aa4/src/progress.rs#L104-L120

This issue would be solved with them returning a Result<()> with an error condition stating the voter/learner is already present, or some other #[must_use] value so that the user knows they need to handle this return value.

@Hoverbear
Copy link
Contributor Author

This is resolved now. #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement An improvement to existing code. Good First Issue A good issue for a new contributor.
Projects
None yet
Development

No branches or pull requests

1 participant