From b551d81f8d6596220053037166d7a3179a159609 Mon Sep 17 00:00:00 2001 From: teor Date: Sat, 23 Jan 2021 09:05:44 +1000 Subject: [PATCH] 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. --- zebra-network/src/peer/connection.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zebra-network/src/peer/connection.rs b/zebra-network/src/peer/connection.rs index 7fd535aa9..0517363a2 100644 --- a/zebra-network/src/peer/connection.rs +++ b/zebra-network/src/peer/connection.rs @@ -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,