From 7073242ccce851ca6569a74e90c811ade01ff6a5 Mon Sep 17 00:00:00 2001 From: Lion - dapplion <35266934+dapplion@users.noreply.github.com> Date: Thu, 23 May 2024 16:34:49 +0200 Subject: [PATCH] Suppress RPC Error disconnect log (#5802) * Suppress RPC Error disconnect log --- beacon_node/lighthouse_network/src/service/mod.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/beacon_node/lighthouse_network/src/service/mod.rs b/beacon_node/lighthouse_network/src/service/mod.rs index 8ed8658a4bb..86086feda3d 100644 --- a/beacon_node/lighthouse_network/src/service/mod.rs +++ b/beacon_node/lighthouse_network/src/service/mod.rs @@ -1383,14 +1383,21 @@ impl Network { // Silencing this event breaks the API contract with RPC where every request ends with // - A stream termination event, or // - An RPCError event - if !matches!(event.event, HandlerEvent::Err(HandlerErr::Outbound { .. })) { + return if let HandlerEvent::Err(HandlerErr::Outbound { + id: RequestId::Application(id), + error, + .. + }) = event.event + { + Some(NetworkEvent::RPCFailed { peer_id, id, error }) + } else { debug!( self.log, "Ignoring rpc message of disconnecting peer"; event ); - return None; - } + None + }; } let handler_id = event.conn_id;