plugin/azure: don't hold zMu across zone Lookup (#8447)

This commit is contained in:
Pujitha Paladugu
2026-08-17 05:11:16 -07:00
committed by GitHub
parent 29ef323f82
commit 897b4ce643
2 changed files with 114 additions and 1 deletions

View File

@@ -319,10 +319,15 @@ func (h *Azure) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
m.Authoritative = true
var result file.Result
for _, z := range zones {
// Only the zone pointer itself needs to be guarded against a
// concurrent swap in updateZones; Lookup can run unlocked since it
// may block for a while resolving external names via upstream.
h.zMu.RLock()
m.Answer, m.Ns, m.Extra, result = z.z.Lookup(ctx, state, qname)
zz := z.z
h.zMu.RUnlock()
m.Answer, m.Ns, m.Extra, result = zz.Lookup(ctx, state, qname)
// record type exists for this name (NODATA).
if len(m.Answer) != 0 || result == file.NoData {
break