Fix some test races and other things found with go test -race (#711)

This commit is contained in:
Raja Subramanian
2022-05-24 10:16:36 +05:30
committed by GitHub
parent a1e264bf34
commit 33032f6c4b
5 changed files with 57 additions and 16 deletions
+2 -2
View File
@@ -210,8 +210,8 @@ func (p *Prober) ProbeSent(size int) {
}
func (p *Prober) getFrontCluster() *Cluster {
p.clustersMu.RLock()
defer p.clustersMu.RUnlock()
p.clustersMu.Lock()
defer p.clustersMu.Unlock()
if p.activeCluster != nil {
return p.activeCluster