Explain why we stay connected on Inbound errors

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.
This commit is contained in:
teor 2021-01-23 09:05:44 +10:00 committed by Jane Lusby
parent 29fa9f5a0a
commit b551d81f8d
1 changed files with 4 additions and 1 deletions

View File

@ -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,