From 38711ea050571f60bcc132b8f841d90bd858d965 Mon Sep 17 00:00:00 2001 From: Sam Andreae Date: Wed, 26 Jul 2023 19:10:58 +0100 Subject: [PATCH 1/2] Reduce chatty warnings in network and replication services --- aquadoggo/src/network/service.rs | 20 ++++++++++---------- aquadoggo/src/replication/manager.rs | 2 +- aquadoggo/src/replication/service.rs | 8 ++++++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/aquadoggo/src/network/service.rs b/aquadoggo/src/network/service.rs index 6ace2f910..ebf504f41 100644 --- a/aquadoggo/src/network/service.rs +++ b/aquadoggo/src/network/service.rs @@ -296,7 +296,7 @@ impl EventLoop { send_back_addr, .. } => { - warn!("Incoming connection error occurred with {local_addr} and {send_back_addr} on connection {connection_id:?}"); + debug!("Incoming connection error occurred with {local_addr} and {send_back_addr} on connection {connection_id:?}"); } SwarmEvent::ListenerClosed { listener_id, @@ -304,7 +304,7 @@ impl EventLoop { reason, } => trace!("Listener closed: {listener_id:?} {addresses:?} {reason:?}"), SwarmEvent::ListenerError { error, .. } => { - warn!("Listener failed with error: {error}") + debug!("Listener failed with error: {error}") } SwarmEvent::NewListenAddr { address, @@ -318,10 +318,10 @@ impl EventLoop { .. } => match peer_id { Some(id) => { - warn!("Outgoing connection error with peer {id} occurred on connection {connection_id:?}"); + debug!("Outgoing connection error with peer {id} occurred on connection {connection_id:?}"); } None => { - warn!("Outgoing connection error occurred on connection {connection_id:?}"); + debug!("Outgoing connection error occurred on connection {connection_id:?}"); } }, @@ -381,7 +381,7 @@ impl EventLoop { } } rendezvous::client::Event::RegisterFailed { error, .. } => { - warn!("Failed to register with rendezvous point: {error:?}"); + debug!("Failed to register with rendezvous point: {error:?}"); } rendezvous::client::Event::DiscoverFailed { error, .. } => { trace!("Discovery failed: {error:?}") @@ -433,7 +433,7 @@ impl EventLoop { ) { Ok(_) => (), Err(_) => { - warn!("Failed to register peer: {rendezvous_peer_id}") + debug!("Failed to register peer: {rendezvous_peer_id}") } }; } @@ -445,7 +445,7 @@ impl EventLoop { ) } identify::Event::Error { peer_id, error } => { - warn!("Failed to identify the remote peer {peer_id}: {error}") + debug!("Failed to identify the remote peer {peer_id}: {error}") } } } @@ -485,7 +485,7 @@ impl EventLoop { ) { Ok(_) => (), Err(_) => { - warn!("Failed to register peer: {rendezvous_peer_id}") + debug!("Failed to register peer: {rendezvous_peer_id}") } }; } @@ -531,8 +531,8 @@ impl EventLoop { .condition(PeerCondition::NotDialing) .build(), ) { - Ok(_) => debug!("Dialing peer: {peer_id}"), - Err(_) => warn!("Error dialing peer: {peer_id}"), + Ok(()) => debug!("Dialing peer: {peer_id}"), + Err(error) => debug!("Error dialing peer {peer_id}: {error}"), }; } }, diff --git a/aquadoggo/src/replication/manager.rs b/aquadoggo/src/replication/manager.rs index 96ddf054c..441ea3b03 100644 --- a/aquadoggo/src/replication/manager.rs +++ b/aquadoggo/src/replication/manager.rs @@ -131,7 +131,7 @@ where { sessions.remove(index); } else { - warn!( + debug!( "Tried to remove nonexistent session {} with peer: {}", session_id, remote_peer.display() diff --git a/aquadoggo/src/replication/service.rs b/aquadoggo/src/replication/service.rs index 63dcb3d22..c9523bc31 100644 --- a/aquadoggo/src/replication/service.rs +++ b/aquadoggo/src/replication/service.rs @@ -5,7 +5,7 @@ use std::time::Duration; use anyhow::Result; use libp2p::PeerId; -use log::{info, trace, warn}; +use log::{debug, info, trace, warn}; use p2panda_rs::schema::SchemaId; use p2panda_rs::Human; use tokio::task; @@ -217,7 +217,11 @@ impl ConnectionManager { session_id: SessionId, error: ReplicationError, ) { - warn!("Replication with peer {} failed: {}", peer.display(), error); + if let ReplicationError::NoSessionFound(_, _) = error { + debug!("Replication session not found: {}", error); + } else { + warn!("Replication failed: {}", error); + } match self.peers.get_mut(&peer) { Some(status) => { From 4d385306a7e3c9d4a836cc43ab759ec90d6e0265 Mon Sep 17 00:00:00 2001 From: Sam Andreae Date: Wed, 26 Jul 2023 19:16:40 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f249fd78..e253509b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Check for duplicate entries arriving to `Ingest` before consuming [#439](https://github.com/p2panda/aquadoggo/pull/439) - Replicate entries in their topologically sorted document order [#442](https://github.com/p2panda/aquadoggo/pull/442) - Remove `quick_commit` from materialization service [#450](https://github.com/p2panda/aquadoggo/pull/450) +- Reduce `warn` logging in network and replication services [#467](https://github.com/p2panda/aquadoggo/pull/467) ### Fixed