Skip to content

Commit

Permalink
level down libp2p quic accept and close errors (#6148)
Browse files Browse the repository at this point in the history
* ignore libp2p-quic accept and close errors
  • Loading branch information
jxs authored Jul 23, 2024
1 parent 9ac647c commit d72dca5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions beacon_node/lighthouse_network/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d72dca5

Please sign in to comment.