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, .. } => {
// 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::<libp2p::quic::Error>())
.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