Comments (1)
@moshloop I was looking into this issue.
I've found that timeout for DNS checks are read from system /etc/resolv.conf file, and there is no way to set it with stdlib on runtime (except tweaking /etc/resolv.conf)
Explanation:
Here is where actual timeout for DNS call is set
https://github.com/golang/go/blob/master/src/net/dnsclient_unix.go#L153
And this exchange
func is called from tryOneName
https://github.com/golang/go/blob/master/src/net/dnsclient_unix.go#L256
where timeOut is read from cfg *dnsConfig
And this call is initiated here
https://github.com/golang/go/blob/master/src/net/dnsclient_unix.go#L595
And finally the dnsConfig is read here
https://github.com/golang/go/blob/master/src/net/dnsclient_unix.go#L579
And if you carefully check that dnsConfig
https://github.com/golang/go/blob/master/src/net/dnsconfig_unix.go#L40
There is either default set for timeout
conf := &dnsConfig{
ndots: 1,
timeout: 5 * time.Second,
attempts: 2,
}
or reading it out of the hardcoded file /etc/resolv.conf
either here
https://github.com/golang/go/blob/master/src/net/dnsclient_unix.go#L337
or here
https://github.com/golang/go/blob/ca978a5ca9390dc759f20db989b49ad9cdcd81d4/src/net/conf.go#L100
So finally it gives us no option to adjust it it on runtime with any config set.
Couple of ideas is to write own dnsCheck thing, which I am not sure if worth for just having a timeout, or somehow tweak that file during calls, but I am not sure if filesystem will be quick enough for concurrent routines.
from canary-checker.
Related Issues (20)
- Upstream pull does not re-use client with tls settings
- Exec check - Add support for Junit output
- Exec check - Artifact archiving HOT 1
- Link health checks to config / components
- Change property fields (min, max, value, text) to Lookup types
- invalid uuid error HOT 1
- Persist checks when persisting canary HOT 1
- Split details/error/message from check_status HOT 1
- Canary checker crashed with a panic HOT 1
- Topology: When a component is construtced from a template, the spec it adheres to is the db specification not kubernetes CRD
- HTTP check should be able to use `envFrom` in url HOT 1
- canary-checker run duplicates logs
- Check Summary - switch to resource selector based filters
- Tracing improvements
- Explore go-memdb for keeping an in-memory db and use NOTIFY to update it
- SyncCheckStatuses bugs
- CLI download for windows detected as a Trojan by defender HOT 1
- Chart - Least Privileged RBAC
- add tests for gcs folder check
- Mount dind image as a sidecar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canary-checker.