Hoverbear / old-raft-rs

[Incomplete] A Raft implementation in Rust
https://hoverbear.github.io/raft-rs/raft/
MIT License
266 stars 41 forks source link

remove or document all uses of unwrap in raft::Server. #33

Closed danburkert closed 9 years ago

danburkert commented 9 years ago

Most uses of panicking functions (unwrap and expect) have been removed, except in a few documented places. With this commit the story around error handling in server.rs is complete using the following guidelines:

Hoverbear commented 9 years ago

Reseting a peer connection means closing the current TCP socket, waiting for reconnection period (currently determined via exponential-backoff with jitter), and then attempting to reconnect. If a peer server connects to the server, the current connection to that peer is replaced with the new one. This ensures that only a single TCP connection is open to a peer at a time.

Awesome.