mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -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:
@@ -44,7 +44,9 @@ func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string)
|
||||
// If z is a secondary zone we might not have transferred it, meaning we have
|
||||
// all zone context setup, except the actual record. This means (for one thing) the apex
|
||||
// is empty and we don't have a SOA record.
|
||||
z.apexMu.RLock()
|
||||
soa := z.Apex.SOA
|
||||
z.apexMu.RUnlock()
|
||||
if soa == nil {
|
||||
return nil, nil, nil, ServerFailure
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user