plugin/file: load secondary zones lazily on startup (#2944)

This fixes a long standing bug:
fixes: #1609

Load secondary zones in a go-routine; this required another mutex to
protect some fields; I think those were needded anyway because a
transfer can also happen when we're running; we just didn't have a test
for that situation.

The test had to be changed to wait for the transfer to happen at this is
async now.

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2019-06-29 22:22:34 +01:00
committed by Yong Tang
parent 2c1f5009be
commit 3a0c7c6153
7 changed files with 21 additions and 17 deletions

View File

@@ -18,8 +18,8 @@ var log = clog.NewWithPlugin("file")
type (
// File is the plugin that reads zone data from disk.
File struct {
Next plugin.Handler
Zones Zones
Next plugin.Handler
Zones
}
// Zones maps zone names to a *Zone.