From 7b8cf9df905a5e5f3fe9918a31edb406d50941d1 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Tue, 29 Aug 2017 21:23:13 +0200 Subject: [PATCH] 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. --- middleware/health/setup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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