level down libp2p quic accept and close errors (#6148)

* ignore libp2p-quic accept and close errors
This commit is contained in:
João Oliveira
2024-07-23 05:29:48 +01:00
committed by GitHub
parent 9ac647c0b5
commit d72dca5e79

View File

@@ -1840,13 +1840,17 @@ impl<E: EthSpec> Network<E> {
} }
} }
SwarmEvent::ListenerError { error, .. } => { SwarmEvent::ListenerError { error, .. } => {
// this is non fatal, but we still check // Ignore quic accept and close errors.
warn!(self.log, "Listener error"; "error" => ?error); if let Some(error) = error
if Swarm::listeners(&self.swarm).count() == 0 { .get_ref()
Some(NetworkEvent::ZeroListeners) .and_then(|err| err.downcast_ref::<libp2p::quic::Error>())
.filter(|err| matches!(err, libp2p::quic::Error::Connection(_)))
{
debug!(self.log, "Listener closed quic connection"; "reason" => ?error);
} else { } else {
None warn!(self.log, "Listener error"; "error" => ?error);
} }
None
} }
_ => { _ => {
// NOTE: SwarmEvent is a non exhaustive enum so updates should be based on // NOTE: SwarmEvent is a non exhaustive enum so updates should be based on