Skip to content

Commit

Permalink
ignore libp2p-quic accept and close errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jxs committed Jul 22, 2024
1 parent bca732e commit 8824d44
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions beacon_node/lighthouse_network/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1840,13 +1840,16 @@ 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)
} else {
None
// Ignore quic accept and close errors.
if error
.get_ref()
.and_then(|err| err.downcast_ref::<libp2p::quic::Error>())
.filter(|err| matches!(err, libp2p::quic::Error::Connection(_)))
.is_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 8824d44

Please sign in to comment.