Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

level down libp2p quic accept and close errors #6148

Merged
merged 1 commit into from
Jul 23, 2024
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
ignore libp2p-quic accept and close errors
  • Loading branch information
jxs committed Jul 22, 2024
commit 5ec2ffb45e47ed4545faeb7bb73517e562bb5324
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