Commit graph

16 commits

Author SHA1 Message Date
Pat Downey
f823825f8a
plugin/forward: Allow Proxy to be used outside of forward plugin. (#5951)
* plugin/forward: Move Proxy into pkg/plugin/proxy, to allow forward.Proxy to be used outside of forward plugin.

Signed-off-by: Patrick Downey <patrick.downey@dioadconsulting.com>
2023-03-24 08:55:51 -04:00
Chris O'Haver
513f27b9a9
plugin/forward: Enable multiple forward declarations (#5127)
* enable multiple declarations of forward plugin

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-07-20 10:35:04 -04:00
Miek Gieben
b003d06003
For caddy v1 in our org (#4018)
* For caddy v1 in our org

This RP changes all imports for caddyserver/caddy to coredns/caddy. This
is the v1 code of caddy.

For the coredns/caddy repo the following changes have been made:

* anything not needed by us is deleted
* all `telemetry` stuff is deleted
* all its import paths are also changed to point to coredns/caddy
* the v1 branch has been moved to the master branch
* a v1.1.0 tag has been added to signal the latest release

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix imports

Signed-off-by: Miek Gieben <miek@miek.nl>

* Group coredns/caddy with out plugins

Signed-off-by: Miek Gieben <miek@miek.nl>

* remove this file

Signed-off-by: Miek Gieben <miek@miek.nl>

* Relax import ordering

github.com/coredns is now also a coredns dep, this makes
github.com/coredns/caddy fit more natural in the list.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix final import

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-24 18:14:41 +02:00
Zou Nengren
20c4f28a5c
remove TestProxyClose (#4005)
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
2020-07-13 08:26:43 -07:00
Miek Gieben
2d98d520b5
plugin/forward: make Yield not block (#3336)
* plugin/forward: may Yield not block

Yield may block when we're super busy with creating (and looking) for
connection. Set a small timeout on Yield, to skip putting the connection
back in the queue.

Use persistentConn troughout the socket handling code to be more
consistent.

Signed-off-by: Miek Gieben <miek@miek.nl>

Dont do

Signed-off-by: Miek Gieben <miek@miek.nl>

* Set used in Yield

This gives one central place where we update used in the persistConns

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-01 16:39:42 +01:00
Yong Tang
f8bba51f84
Update Caddy to 1.0.1, and update import path (#2961)
* Update Caddy to 1.0.1, and update import path

This fix updates caddy to 1.0.1 and also
updates the import path to github.com/caddyserver/caddy

This fix fixes 2959

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Also update plugin.cfg

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update and bump zplugin.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-03 09:04:47 +08:00
Miek Gieben
c349446a23
Cleanup ParseHostOrFile (#2100)
Create plugin/pkg/transport that holds the transport related functions.
This needed to be a new pkg to prevent cyclic import errors.

This cleans up a bunch of duplicated code in core/dnsserver that also
tried to parse a transport (now all done in transport.Parse).

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-19 07:29:37 +01:00
Miek Gieben
a536833546
plugin/forward: add HealthChecker interface (#1950)
* plugin/forward: add HealthChecker interface

Make the HealthChecker interface and morph the current DNS health
checker into that interface.

Remove all whole bunch of method on Forward that didn't make sense.

This is done in preparation of adding a DoH client to forward - which
requires a completely different healthcheck implementation (and more,
but lets start here)

Signed-off-by: Miek Gieben <miek@miek.nl>

* Use protocol

Signed-off-by: Miek Gieben <miek@miek.nl>

* Dial doesnt need to be method an Forward either

Signed-off-by: Miek Gieben <miek@miek.nl>

* Address comments

Address various comments on the PR.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-09 15:14:55 +01:00
Ruslan Drozhdzh
bc50901234 plugin/forward: add prefer_udp option (#1944)
* plugin/forward: add prefer_udp option

* updated according to code review

 - fixed linter warning
 - removed metric parameter in Proxy.Connect()
2018-07-07 08:14:21 +01:00
Tobias Schmidt
422aec5f5f plugin/forward: Increase minimum read timeout to 200ms (#1889)
After several experiments at SoundCloud we found that the current
minimum read timeout of 10ms is too low. A single request against a
slow/unavailable authoritative server can cause all TCP connections to
get closed. We record a 50th percentile forward/proxy latency of <5ms,
and a 99th percentile latency of 60ms. Using a minimum timeout of 200ms
seems to be a fair trade-off between avoiding unnecessary high
connection churn and reacting to upstream failures in a timely manner.

This change also renames hcDuration to hcInterval to reflect its usage,
and removes the duplicated timeout constant to make code comprehension
easier.
2018-06-21 11:40:19 +01:00
Eugen Kleiner
be8fcc484a plugin/forward: expose few methods and attributes to public (#1766)
* plugin/forward: expose few methods and attributes to public

* Update comments
2018-05-04 07:47:26 +02:00
Miek Gieben
270da82995
plugin/forward: move Dial goroutine out (#1738)
Rework the TestProxyClose - close the proxy in the *same* goroutine
as where we started it. Close channels as long as we don't get dataraces
(this may need another fix).

Move the Dial goroutine out of the connManager - this simplifies things
*and* makes another goroutine go away and removes the need for connErr
channels - can now just be dns.Conn.

Also:

Revert "plugin/forward: gracefull stop (#1701)"
This reverts commit 135377bf77.

Revert "rework TestProxyClose (#1735)"
This reverts commit 9e8893a0b5.
2018-04-26 09:34:58 +01:00
Ruslan Drozhdzh
9e8893a0b5 rework TestProxyClose (#1735) 2018-04-25 19:15:49 +01:00
Miek Gieben
ce084012df
plugin/forward: fix TLS setup (#1714)
* plugin/forward: fix TLS setup

Way smaller PR than #1679. Fixes same thing.

* remove println

* put overwritten test back

* context

* update tests
2018-04-24 18:18:26 +01:00
Miek Gieben
f529a2771f
plugin/forward: close channels when connManager returns (#1727)
Close a bunch of channels, also change the test to just use a for loop
with a counter.
2018-04-24 17:09:15 +01:00
Ruslan Drozhdzh
135377bf77
plugin/forward: gracefull stop (#1701)
* plugin/forward: gracefull stop

 - stop connection manager only when no queries in progress

* minor improvement

* prevent healthcheck on stopped proxy

* revert closing channels

* use standard context
2018-04-20 17:47:46 +03:00