mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
Call wg.Add in main goroutine to avoid race conditons. (#3433)
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
This commit is contained in:
committed by
Miek Gieben
parent
1942746c48
commit
113783ed91
@@ -109,8 +109,8 @@ func (t Transfer) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
ch := make(chan *dns.Envelope)
|
||||
tr := new(dns.Transfer)
|
||||
wg := new(sync.WaitGroup)
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
wg.Add(1)
|
||||
tr.Out(w, r, ch)
|
||||
wg.Done()
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user