Miek Gieben 076b8d4fba plugin/health: add OnRestartFailed (#2812)
Add OnReStartFailed which makes the health plugin stay up if the
Corefile is corrupt and we revert to the previous version.

Also needs a fix for the channel handling

See #2659

Testing it will log the following when restarting with a corrupted
Corefile

~~~
2019-05-04T18:01:59.431Z [INFO] linux/amd64, go1.12.4,
CoreDNS-1.5.0
linux/amd64, go1.12.4,
[INFO] SIGUSR1: Reloading
[INFO] Reloading
[ERROR] Restart failed: Corefile:5 - Error during parsing: Unknown directive 'bdhfhdhj'
[ERROR] SIGUSR1: starting with listener file descriptors: Corefile:5 - Error during parsing: Unknown directive 'bdhfhdhj'
~~~

After which the curl still works.

This also needed a change to reset the channel used for the metrics
go-routine which gets closed on shutdown, otherwise you'll see:

~~~
^C[INFO] SIGINT: Shutting down
panic: close of closed channel

goroutine 90 [running]:
github.com/coredns/coredns/plugin/health.(*health).OnFinalShutdown(0xc000089bc0, 0xc000063d88, 0x4afe6d)
~~~

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-04 16:06:25 -04:00
..
2019-04-28 11:46:45 +01:00
2019-04-01 10:38:17 -04:00
2018-07-19 16:23:06 +01:00
2019-04-30 13:49:53 -04:00
2019-02-17 08:31:58 +00:00
2019-04-29 13:51:45 -04:00
2019-04-24 07:01:44 +01:00
2019-02-21 07:23:34 +00:00
2019-04-08 11:13:46 +01:00
2018-07-19 16:23:06 +01:00
2019-04-08 11:15:05 +01:00
2019-04-29 13:51:45 -04:00
2019-03-07 20:35:16 +00:00
2018-08-14 08:55:55 -07:00
2019-03-04 07:32:38 +00:00
2018-07-19 16:23:06 +01:00