diff options
author | 2022-07-06 13:52:18 -0400 | |
---|---|---|
committer | 2022-07-06 13:52:18 -0400 | |
commit | d903a963eeb3454996846811fb850ceb8c4fea81 (patch) | |
tree | 4ec75580e9f540e42ca0842b5afb57308ce2d209 /plugin | |
parent | a6078ddba3d193f2a8fda57d490aa6b65922159b (diff) | |
download | coredns-d903a963eeb3454996846811fb850ceb8c4fea81.tar.gz coredns-d903a963eeb3454996846811fb850ceb8c4fea81.tar.zst coredns-d903a963eeb3454996846811fb850ceb8c4fea81.zip |
dont lameduck when reloading (#5472)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/health/health.go | 12 | ||||
-rw-r--r-- | plugin/health/setup.go | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/plugin/health/health.go b/plugin/health/health.go index a71c00c8c..c69b221ec 100644 --- a/plugin/health/health.go +++ b/plugin/health/health.go @@ -70,3 +70,15 @@ func (h *health) OnFinalShutdown() error { h.nlSetup = false return nil } + +func (h *health) OnReload() error { + if !h.nlSetup { + return nil + } + + h.stop() + + h.ln.Close() + h.nlSetup = false + return nil +} diff --git a/plugin/health/setup.go b/plugin/health/setup.go index 624d88dd5..e9163ad44 100644 --- a/plugin/health/setup.go +++ b/plugin/health/setup.go @@ -20,7 +20,7 @@ func setup(c *caddy.Controller) error { h := &health{Addr: addr, lameduck: lame} c.OnStartup(h.OnStartup) - c.OnRestart(h.OnFinalShutdown) + c.OnRestart(h.OnReload) c.OnFinalShutdown(h.OnFinalShutdown) c.OnRestartFailed(h.OnStartup) |