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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce chatty warnings in network and replication services #467

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 10 additions & 10 deletions aquadoggo/src/network/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@ 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,
addresses,
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,
Expand All @@ -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:?}");
}
},

Expand Down Expand Up @@ -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:?}")
Expand Down Expand Up @@ -433,7 +433,7 @@ impl EventLoop {
) {
Ok(_) => (),
Err(_) => {
warn!("Failed to register peer: {rendezvous_peer_id}")
debug!("Failed to register peer: {rendezvous_peer_id}")
}
};
}
Expand All @@ -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}")
}
}
}
Expand Down Expand Up @@ -485,7 +485,7 @@ impl EventLoop {
) {
Ok(_) => (),
Err(_) => {
warn!("Failed to register peer: {rendezvous_peer_id}")
debug!("Failed to register peer: {rendezvous_peer_id}")
}
};
}
Expand Down Expand Up @@ -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}"),
};
}
},
Expand Down
2 changes: 1 addition & 1 deletion aquadoggo/src/replication/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ where
{
sessions.remove(index);
} else {
warn!(
debug!(
"Tried to remove nonexistent session {} with peer: {}",
session_id,
remote_peer.display()
Expand Down
8 changes: 6 additions & 2 deletions aquadoggo/src/replication/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) => {
Expand Down