Skip to content

Commit

Permalink
fix: reduce some logs to debug (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler authored Nov 7, 2024
1 parent 733800f commit 75f5bc3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/server/p2p/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use libp2p::{
multiaddr::Protocol,
noise,
relay,
request_response::{self, cbor, OutboundRequestId, ResponseChannel},
request_response::{self, cbor, OutboundFailure, ResponseChannel},
swarm::{
behaviour::toggle::Toggle,
dial_opts::{DialOpts, PeerCondition},
Expand Down Expand Up @@ -1094,7 +1094,7 @@ where S: ShareChain
send_back_addr,
error,
} => {
error!(target: LOG_TARGET, squad = &self.config.squad; "Incoming connection error: {connection_id:?} -> {local_addr:?} -> {send_back_addr:?} -> {error:?}");
debug!(target: LOG_TARGET, squad = &self.config.squad; "Incoming connection error: {connection_id:?} -> {local_addr:?} -> {send_back_addr:?} -> {error:?}");
},
SwarmEvent::ListenerError { listener_id, error } => {
error!(target: LOG_TARGET, squad = &self.config.squad; "Listener error: {listener_id:?} -> {error:?}");
Expand Down Expand Up @@ -1232,7 +1232,14 @@ where S: ShareChain
request_response::Event::OutboundFailure { peer, error, .. } => {
// Peers can be offline
debug!(target: LOG_TARGET, squad = &self.config.squad; "REQ-RES outbound failure: {peer:?} -> {error:?}");
warn!(target: SYNC_REQUEST_LOG_TARGET, "Catch up sync request failed: {peer:?} -> {error:?}");
match error {
OutboundFailure::DialFailure => {
debug!(target: SYNC_REQUEST_LOG_TARGET, "Catch up sync request failed: {peer:?} -> {error:?}");
},
_ => {
warn!(target: SYNC_REQUEST_LOG_TARGET, "Catch up sync request failed: {peer:?} -> {error:?}");
},
}
// Unlock the permit
self.network_peer_store
.move_to_grey_list(peer, format!("Error during catch up sync:{}", error.to_string()))
Expand Down

0 comments on commit 75f5bc3

Please sign in to comment.