Skip to content

Commit

Permalink
Explain why we stay connected on Inbound errors
Browse files Browse the repository at this point in the history
We might be syncing using this peer, so it's ok to just ignore
any internal errors in their Inbound requests, and drop the
request.
  • Loading branch information
teor2345 authored and yaahc committed Jan 27, 2021
1 parent 29fa9f5 commit b551d81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zebra-network/src/peer/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,10 @@ where
metrics::counter!("pool.closed.loadshed", 1);
self.fail_with(PeerError::Overloaded);
} else {
// We could send a reject to the remote peer.
// We could send a reject to the remote peer, but that might cause
// them to disconnect, and we might be using them to sync blocks.
// For similar reasons, we don't want to fail_with() here - we
// only close the connection if the peer is doing something wrong.
error!(%e,
connection_state = ?self.state,
client_receiver = ?self.client_rx,
Expand Down

0 comments on commit b551d81

Please sign in to comment.