mirror of
https://github.com/coredns/coredns.git
synced 2025-12-09 03:45:11 -05:00
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:
@@ -51,9 +51,11 @@ Transfer:
|
||||
return Err
|
||||
}
|
||||
|
||||
z.apexMu.Lock()
|
||||
z.Tree = z1.Tree
|
||||
z.Apex = z1.Apex
|
||||
*z.Expired = false
|
||||
z.apexMu.Unlock()
|
||||
log.Infof("Transferred: %s from %s", z.origin, tr)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user