diag: drain ping reply channel to avoid goroutine leak
This commit is contained in:
parent
99c4046ebf
commit
a8fce3cbbc
@ -278,6 +278,11 @@ func (d *ping6) Evaluate() (string, error) {
|
||||
if localAddr[reply.Address.String()] {
|
||||
continue
|
||||
}
|
||||
go func() {
|
||||
for range replies {
|
||||
// drain channel
|
||||
}
|
||||
}()
|
||||
return formatRTT(reply.Duration) + " from " + reply.Address.String(), nil
|
||||
}
|
||||
return "", fmt.Errorf("no responses to %s within %v", addr, timeout)
|
||||
|
Loading…
x
Reference in New Issue
Block a user