Closed danburkert closed 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.
Most uses of panicking functions (
unwrap
andexpect
) 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:assert!
,unwrap!
,expect
, or a indexing operator. These calls should be documented with either a comment, or a message that will be included in the panic. Panicking in these scenarios ensures that if program invariants are broken the server will immediately crash instead of continuing and potentially comprimising safety.try!
, or ignoring the failure with a warn-level log message). When an operation on a connection fails, that connection is always reset. Reseting a client connection means simply dropping it. 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.