Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously we were checking the number of listeners, but it's redundant here as they will only decrease if gracefully closed, ListenerErrors are non fatal and therefore shouldn't close the listener

}
_ => {
// NOTE: SwarmEvent is a non exhaustive enum so updates should be based on
Expand Down