aboutsummaryrefslogtreecommitdiff
path: root/middleware
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-08-29 21:23:13 +0200
committerGravatar GitHub <noreply@github.com> 2017-08-29 21:23:13 +0200
commit7b8cf9df905a5e5f3fe9918a31edb406d50941d1 (patch)
tree78807563358e714c410bec0e14092753e2a6a998 /middleware
parent7e63bdbee8340d3ce2d2488f93d0fb1d4d16a201 (diff)
downloadcoredns-7b8cf9df905a5e5f3fe9918a31edb406d50941d1.tar.gz
coredns-7b8cf9df905a5e5f3fe9918a31edb406d50941d1.tar.zst
coredns-7b8cf9df905a5e5f3fe9918a31edb406d50941d1.zip
mw/health: call Shutdown on FinalShutdown (#1003)
Reloading caddy won't kill the health handler. Only on final shutdown we stop the handler. Currently when reloading CoreDNS with -SIGUSR1 the health handler stops answering - there is a test for this but it doesn't capture whole process reloading, sadly. This PR keeps the handler alive during reloads and only stops on process shutdown.
Diffstat (limited to 'middleware')
-rw-r--r--middleware/health/setup.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/middleware/health/setup.go b/middleware/health/setup.go
index c54a6ea53..bf465bd74 100644
--- a/middleware/health/setup.go
+++ b/middleware/health/setup.go
@@ -47,7 +47,7 @@ func setup(c *caddy.Controller) error {
})
c.OnStartup(h.Startup)
- c.OnShutdown(h.Shutdown)
+ c.OnFinalShutdown(h.Shutdown)
// Don't do AddMiddleware, as health is not *really* a middleware just a separate webserver running.
return nil