mirror of
https://github.com/coredns/coredns.git
synced 2026-10-16 15:25:47 -04:00
plugin/route53: don't hold zMu across zone Lookup (#8601)
This commit is contained in:
committed by
GitHub
parent
f44a91377a
commit
92129ace31
@@ -121,9 +121,14 @@ func (h *Route53) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
m.Authoritative = true
|
||||
var result file.Result
|
||||
for _, hostedZone := range z {
|
||||
// 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, and
|
||||
// a panic inside it must not leave zMu permanently locked.
|
||||
h.zMu.RLock()
|
||||
m.Answer, m.Ns, m.Extra, result = hostedZone.z.Lookup(ctx, state, qname)
|
||||
hz := hostedZone.z
|
||||
h.zMu.RUnlock()
|
||||
m.Answer, m.Ns, m.Extra, result = hz.Lookup(ctx, state, qname)
|
||||
|
||||
// Take the answer if it's non-empty OR if there is another
|
||||
// record type exists for this name (NODATA).
|
||||
|
||||
Reference in New Issue
Block a user