* plugin/forward: TCP conns can be closed
Only when we read and get a io.EOF we know the conn is closed (for TCP).
If this is the case Dial (again) and retry. Note that this new
connection can also be closed by the upstream, we may want to add a
DialForceNew or something to get a new TCP connection..
Simular to #1624, *but* this is by (TCP) design. We also don't have to
wait for a timeout which makes it easier to reason about.
* Move to forward.go
* doesnt need changing
* plugin/metrics: set server address in context
Allow cross server block metrics to co-exist; for this we should label
each metric with the server label. Put this information in the context
and provide a helper function to get it out.
Abstracting with entirely away with difficult as the release client_go
(0.8.0) doesn't have the CurryWith functions yet. So current use is like
so:
define metric, with server label:
RcodeCount = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "forward",
Name: "response_rcode_count_total",
Help: "Counter of requests made per upstream.",
}, []string{"server", "rcode", "to"})
And report ith with the helper function metrics.WithServer:
RcodeCount.WithLabelValues(metrics.WithServer(ctx), rc, p.addr).Add(1)
* plugin/{cache,forward,proxy}: don't allow responses that are bogus
Responses that are not matching what we've been querying for should be
dropped. They are converted into FormErrs by forward and proxy; as a 2nd
backstop cache will also not cache these.
* plug
* add explicit test
* request.Scrub: test for rl==size case
Make a test case for the new break statement in Scrub and also
account for the OPT record that may get re-added in SizeAndDo() -
otherwise we may break clients that expect this.
* Fix comment
Recent bind refactoring missed this:
grpc://example.com.:1055
example.com.:1053 on 127.0.0.1
now becomes
grpc://example.com.:1055 on 127.0.0.1
example.com.:1053 on 127.0.0.1
If you're using *bind* directive.
This PR documents the trick exposed in coredns/coredns#1357 about using wildcards to get all POD IPs from a service with ClusterIP (as used in 'endpoints')
While looking into route53 plugin I notice the test case
was incorrect and does not really test the reply. This
fix fixes the issue in the test.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* plugin/health: make reload work
Remove the once.Do from the startup, so we can re-bind the HTTP
listener. Also clarify the usage of health in multiple server blocks
(this is not the best approach - but there isn't a generic solution at
this point).
Manual tested as we lack testing infra, i.e kill -SIGUSR1 and some
CURLing of the health endpoint.
* Readme test fix
* update
* dont need this
error on startup when we see these in a corefile:
~~~
% ./coredns
2018/03/01 06:51:23 plugin/startup: this plugin has been deprecated
% ./coredns
2018/03/01 06:51:32 plugin/shutdown: this plugin has been deprecated
~~~
* plugin/file: shutdown reload goroutine
Shutdown the z.Reload() routine (if started in the first place) on
shutdow and reload.
Fixes#1508
* Must be put in c.OnShutdown()
* up test coverage
* Easier way to dnstap?
* Remove unnecessary function parameter from Tapper
* golint
* golint 2
* Proxy dnstap tests
* README.md & doc
* net.IP
* Proxy test was incorrect
* Small changes
* Update README.md
* Was not reporting dnstap errors + test
* Wasn't working at all, now it's ok
* Thanks Travis