From 5ec2ffb45e47ed4545faeb7bb73517e562bb5324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Mon, 22 Jul 2024 18:14:41 +0100 Subject: [PATCH] ignore libp2p-quic accept and close errors --- beacon_node/lighthouse_network/src/service/mod.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/beacon_node/lighthouse_network/src/service/mod.rs b/beacon_node/lighthouse_network/src/service/mod.rs index 2868c616bdd..3d502e6fdce 100644 --- a/beacon_node/lighthouse_network/src/service/mod.rs +++ b/beacon_node/lighthouse_network/src/service/mod.rs @@ -1840,13 +1840,17 @@ impl Network { } } SwarmEvent::ListenerError { error, .. } => { - // this is non fatal, but we still check - warn!(self.log, "Listener error"; "error" => ?error); - if Swarm::listeners(&self.swarm).count() == 0 { - Some(NetworkEvent::ZeroListeners) + // Ignore quic accept and close errors. + if let Some(error) = error + .get_ref() + .and_then(|err| err.downcast_ref::()) + .filter(|err| matches!(err, libp2p::quic::Error::Connection(_))) + { + debug!(self.log, "Listener closed quic connection"; "reason" => ?error); } else { - None + warn!(self.log, "Listener error"; "error" => ?error); } + None } _ => { // NOTE: SwarmEvent is a non exhaustive enum so updates should be based on