Fix deadlock when Telegraf is aligning aggregators (#5612)
This commit is contained in:
parent
5d9b829776
commit
33ee309fd1
|
@ -378,7 +378,10 @@ func (a *Agent) runAggregators(
|
||||||
for _, agg := range a.Config.Aggregators {
|
for _, agg := range a.Config.Aggregators {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func(agg *models.RunningAggregator) {
|
go func(agg *models.RunningAggregator) {
|
||||||
defer wg.Done()
|
defer func() {
|
||||||
|
wg.Done()
|
||||||
|
close(aggregations)
|
||||||
|
}()
|
||||||
|
|
||||||
if a.Config.Agent.RoundInterval {
|
if a.Config.Agent.RoundInterval {
|
||||||
// Aggregators are aligned to the agent interval regardless of
|
// Aggregators are aligned to the agent interval regardless of
|
||||||
|
@ -394,7 +397,6 @@ func (a *Agent) runAggregators(
|
||||||
acc := NewAccumulator(agg, aggregations)
|
acc := NewAccumulator(agg, aggregations)
|
||||||
acc.SetPrecision(precision, interval)
|
acc.SetPrecision(precision, interval)
|
||||||
a.push(ctx, agg, acc)
|
a.push(ctx, agg, acc)
|
||||||
close(aggregations)
|
|
||||||
}(agg)
|
}(agg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue