mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
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 commit135377bf77. Revert "rework TestProxyClose (#1735)" This reverts commit9e8893a0b5.
This commit is contained in:
@@ -119,7 +119,7 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
|
||||
if err != nil {
|
||||
// Kick off health check to see if *our* upstream is broken.
|
||||
if f.maxfails != 0 && err != errStopped {
|
||||
if f.maxfails != 0 {
|
||||
proxy.Healthcheck()
|
||||
}
|
||||
|
||||
@@ -185,7 +185,6 @@ var (
|
||||
errNoHealthy = errors.New("no healthy proxies")
|
||||
errNoForward = errors.New("no forwarder defined")
|
||||
errCachedClosed = errors.New("cached connection was closed by peer")
|
||||
errStopped = errors.New("proxy has been stopped")
|
||||
)
|
||||
|
||||
// policy tells forward what policy for selecting upstream it uses.
|
||||
|
||||
Reference in New Issue
Block a user