Skip to content

Commit f10d3d0

Browse files
committed
remove crit! logging from ListenerClosed event on Ok() (#4821)
## Issue Addressed Since adding Quic support on #4577, and due to `quinn`s api nature LH now triggers the [`ListenerClosed`](https://docs.rs/libp2p/0.52.3/libp2p/swarm/struct.ListenerClosed.html) event.. @michaelsproul noticed we are logging this event as `crit!` independently of the reason. This PR matches the reason, logging with `debug!` and `error!` (instead of `crit!`) according to its `Result` ## Additional Info LH will still log `crit!` until libp2p/rust-libp2p#4621 has been merged
1 parent 18f3edf commit f10d3d0

File tree

1 file changed

+8
-1
lines changed
  • beacon_node/lighthouse_network/src/service

1 file changed

+8
-1
lines changed

beacon_node/lighthouse_network/src/service/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,14 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
16021602
SwarmEvent::ListenerClosed {
16031603
addresses, reason, ..
16041604
} => {
1605-
crit!(self.log, "Listener closed"; "addresses" => ?addresses, "reason" => ?reason);
1605+
match reason {
1606+
Ok(_) => {
1607+
debug!(self.log, "Listener gracefuly closed"; "addresses" => ?addresses)
1608+
}
1609+
Err(reason) => {
1610+
crit!(self.log, "Listener abruptly closed"; "addresses" => ?addresses, "reason" => ?reason)
1611+
}
1612+
};
16061613
if Swarm::listeners(&self.swarm).count() == 0 {
16071614
Some(NetworkEvent::ZeroListeners)
16081615
} else {

0 commit comments

Comments
 (0)