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

chore: dont log if nothing to evict #12015

Merged
merged 1 commit into from
Oct 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
25 changes: 16 additions & 9 deletions crates/net/discv4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1513,11 +1513,12 @@ impl Discv4Service {
true
});

trace!(target: "discv4", num=%failed_pings.len(), "evicting nodes due to failed pong");

// remove nodes that failed to pong
for node_id in failed_pings {
self.remove_node(node_id);
if !failed_pings.is_empty() {
// remove nodes that failed to pong
trace!(target: "discv4", num=%failed_pings.len(), "evicting nodes due to failed pong");
for node_id in failed_pings {
self.remove_node(node_id);
}
}

let mut failed_lookups = Vec::new();
Expand All @@ -1528,11 +1529,13 @@ impl Discv4Service {
}
true
});
trace!(target: "discv4", num=%failed_lookups.len(), "evicting nodes due to failed lookup");

// remove nodes that failed the e2e lookup process, so we can restart it
for node_id in failed_lookups {
self.remove_node(node_id);
if !failed_lookups.is_empty() {
// remove nodes that failed the e2e lookup process, so we can restart it
trace!(target: "discv4", num=%failed_lookups.len(), "evicting nodes due to failed lookup");
for node_id in failed_lookups {
self.remove_node(node_id);
}
}

self.evict_failed_find_nodes(now);
Expand All @@ -1553,6 +1556,10 @@ impl Discv4Service {
true
});

if failed_find_nodes.is_empty() {
return
}

trace!(target: "discv4", num=%failed_find_nodes.len(), "processing failed find nodes");

for node_id in failed_find_nodes {
Expand Down
Loading