diff options
author | 2019-06-09 08:10:15 +0100 | |
---|---|---|
committer | 2019-06-09 08:10:15 +0100 | |
commit | a1c97f82a6f27ae1f4489a1dc5d0bc6fa4cce9ed (patch) | |
tree | 2d3e175189784fc2feca6e712c39dcbe82c4836a /plugin/ready/ready.go | |
parent | bd83f74deb9e277ad5d101352a195cda548406c4 (diff) | |
download | coredns-a1c97f82a6f27ae1f4489a1dc5d0bc6fa4cce9ed.tar.gz coredns-a1c97f82a6f27ae1f4489a1dc5d0bc6fa4cce9ed.tar.zst coredns-a1c97f82a6f27ae1f4489a1dc5d0bc6fa4cce9ed.zip |
plugin/ready: fix starts and restarts (#2814)
Add OnRestartFailed to the ready plugin and some various cleanups.
Document slightly better how things are supposed to work with multiple
`ready`'s in the multiple Server Blocks.
All manually tested with this Corefile:
~~~
. {
log
ready
}
example.org {
log
chaos
ready
}
~~~
And then `kill -SIGUSR1` and curling the ready endpoint. This works
well, the FailedReload is triggered by adding a syntax error in the
Corefile.
See #2659
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/ready/ready.go')
-rw-r--r-- | plugin/ready/ready.go | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/plugin/ready/ready.go b/plugin/ready/ready.go index 692f3f81d..ff19b59f8 100644 --- a/plugin/ready/ready.go +++ b/plugin/ready/ready.go @@ -30,10 +30,6 @@ type ready struct { } func (rd *ready) onStartup() error { - if rd.Addr == "" { - rd.Addr = defAddr - } - ln, err := net.Listen("tcp", rd.Addr) if err != nil { return err @@ -62,8 +58,6 @@ func (rd *ready) onStartup() error { return nil } -func (rd *ready) onRestart() error { return rd.onFinalShutdown() } - func (rd *ready) onFinalShutdown() error { rd.Lock() defer rd.Unlock() @@ -77,5 +71,3 @@ func (rd *ready) onFinalShutdown() error { rd.done = false return nil } - -const defAddr = ":8181" |