Open gspannu opened 6 months ago
Two of my docker containers stopped to respond to DNS queries, when I checked console - both of them were reporting same problem. They were unable to reach any upstream, including local BIND that I use to manage internal DNS. Both worked find after simply restarting containers
Yes, a restart usually does fix the issue.... but I would like to understand what is causing the context deadline exceeded
error.
Some questions about this behavior:
For the first config in the first post it is advised to configure a bootstrap resolver.
Some questions about this behavior:
- is an UDP+TCP resolver configured in the default upstream group?
- is a bootstrap resolver configured?
- does blocky run native or containerized?
- are conditional and custom requests also affected?
1) No. Only DoH and DoT upstream resolvers are configured. 2) Bootstrap resolver is configured. 3) Running Native (on OPNsense router, i.e. FreeBSD) 4) Have not logged or analysed in detail, so not sure.
After reading some about the cause it seems most likely that some resources aren't correctly freed in a previous request.
Could you set the log level to debug and provide the entries of the 2-3 queries before it fails again?
My current guess: TCP pool exhaustion in the HTTP client since the defer body closure is missing a drain method
defer func() {
// drain body in case of error
_,_ := io.ReadAll(httpResponse.Body)
// close drained body
util.LogOnError(ctx, "can't close response body ", httpResponse.Body.Close())
}()
If my guess is correct you should have log entries starting with http return code should be
or http return content type should be
prior to the mentioned error in your first post.
Blocky log is reporting errors related to context deadline exceeded
Here is brief blocky.log
The main error is
context deadline exceeded
My blocky configuration
Any idea why this happens? Or how to resolve?
As an additional note: I do not get these errors when I use my local Unbound instead of upstream Google/Cloudflare. Blocky configuration