framework: Fix a goroutine leak bug in resource_usage_gatherer.go

This commit is contained in:
Boqin Qin
2019-10-14 19:48:50 -04:00
committed by Burton Qin
parent aafbb93fe2
commit 24dcd8eaac

View File

@@ -345,7 +345,7 @@ func (g *ContainerResourceGatherer) StartGatheringData() {
func (g *ContainerResourceGatherer) StopAndSummarize(percentiles []int, constraints map[string]ResourceConstraint) (*ResourceUsageSummary, error) {
close(g.stopCh)
Logf("Closed stop channel. Waiting for %v workers", len(g.workers))
finished := make(chan struct{})
finished := make(chan struct{}, 1)
go func() {
g.workerWg.Wait()
finished <- struct{}{}