Skip to content

Commit

Permalink
Lower session keeper verbocity. Do not log errors for DNS errors, whi…
Browse files Browse the repository at this point in the history
…ch may occur naturally.
  • Loading branch information
Jauler committed Nov 7, 2024
1 parent 3e96b04 commit 7d9394e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Empty file added .unreleased/LLT-5747
Empty file.
19 changes: 16 additions & 3 deletions crates/telio-dns/src/forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,22 @@ impl Authority for ForwardAuthority {
telio_log_debug!("forwarding lookup: {} {}", name, rtype);
let resolve = self.resolver.lookup(name.clone(), rtype).await;

if resolve.is_err() {
telio_log_warn!("DNS name resolution failed with {:?}", resolve);
}
// Log DNS failures
match resolve {
// Some errors are not really relevant, and happens in a wild often.
// For example: no IPs associated with domain especially for AAAA queries
//
// Log such errors with lower logging level
Err(ref e)
if matches!(e.kind(), ResolveErrorKind::NoRecordsFound { .. })
&& (rtype == RecordType::AAAA || rtype == RecordType::SOA) =>
{
telio_log_debug!("DNS name resolution failed with {:?}", e);
}

Err(ref e) => telio_log_warn!("DNS name resolution failed with {:?}", e),
Ok(_) => (),
};

resolve
.map(ForwardLookup)
Expand Down
4 changes: 2 additions & 2 deletions src/device/wg_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ async fn consolidate_wg_peers<
telio_log_warn!("Peer {:?} has no ip address", key);
}
}
(None, _) => telio_log_warn!("The session keeper is missing!"),
(None, _) => telio_log_debug!("The session keeper is missing!"),
_ => (),
}

Expand Down Expand Up @@ -455,7 +455,7 @@ async fn consolidate_wg_peers<
}
}
(Some(_), _, _) => (),
(None, _, _) => telio_log_warn!("The session keeper is missing!"),
(None, _, _) => telio_log_debug!("The session keeper is missing!"),
}

let is_actual_peer_proxying = is_peer_proxying(actual_peer, &proxy_endpoints);
Expand Down

0 comments on commit 7d9394e

Please sign in to comment.