pull/5034/merge
Kyle Carberry 2023-06-19 10:36:07 -04:00 committed by GitHub
commit 932be3d09b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -1005,10 +1005,18 @@ func (c *Client) GetReport(ctx context.Context, dm *tailcfg.DERPMap) (_ *Report,
for _, probeSet := range plan {
setCtx, cancelSet := context.WithCancel(ctx)
go func(probeSet []probe) {
for _, probe := range probeSet {
go rs.runProbe(setCtx, dm, probe, cancelSet)
pwg := syncs.NewWaitGroupChan()
pwg.Add(len(probeSet))
for _, p := range probeSet {
go func(probe probe) {
rs.runProbe(setCtx, dm, probe, cancelSet)
pwg.Decr()
}(p)
}
select {
case <-setCtx.Done():
case <-pwg.DoneChan():
}
<-setCtx.Done()
wg.Decr()
}(probeSet)
}