dnss icon indicating copy to clipboard operation
dnss copied to clipboard

FR: Rate-limit error logs

Open dseomn opened this issue 1 year ago • 2 comments

Hi,

My connection to my ISP recently went down for a short time, and dnss flooded the system logs with connect: network is unreachable errors. Would it be possible to add a rate limit to the logs so that, e.g., the same log message can't be logged more than once per second?

dseomn avatar Jun 14 '24 22:06 dseomn

Hi! Thank you for opening this, sorry it took me so long to triage it.

This seems like a very reasonable feature request, will leave this open to track it :)

Do you have an example of the error messages you got overloaded with? So I know which ones to prioritize. No worries if not, I can simulate this if needed. Thank you!

albertito avatar Jul 07 '24 10:07 albertito

Here are the messages that were filling my logs. The first two had variations with different IP addresses. I'm slightly confused by the last two because dnss is running with --fallback_upstream=[::1]:14653. /etc/resolv.conf has nameserver 127.0.0.53, but I didn't think dnss used that.

server.go:105      resolver query error: POST failed: Post "https://dns.google/dns-query": dial tcp 8.8.4.4:443: connect: network is unreachable
server.go:106      dnsserver Handler: error: POST failed: Post \"https://dns.google/dns-query\": dial tcp 8.8.4.4:443: connect: network is unreachable
server.go:105      resolver query error: POST failed: Post "https://dns.google/dns-query": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
server.go:106      dnsserver Handler: error: POST failed: Post \"https://dns.google/dns-query\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
server.go:105      resolver query error: POST failed: Post "https://dns.google/dns-query": dial tcp: lookup dns.google on 127.0.0.53:53: server misbehaving
server.go:106      dnsserver Handler: error: POST failed: Post \"https://dns.google/dns-query\": dial tcp: lookup dns.google on 127.0.0.53:53: server misbehaving

dseomn avatar Jul 07 '24 16:07 dseomn