Skip to content

Commit

Permalink
Fix deadlock when Telegraf is aligning aggregators (influxdata#5612)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlzt authored and Jean-Louis Dupond committed Apr 22, 2019
1 parent 52729fe commit 88ff858
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,10 @@ func (a *Agent) runAggregators(
for _, agg := range a.Config.Aggregators {
wg.Add(1)
go func(agg *models.RunningAggregator) {
defer wg.Done()
defer func() {
wg.Done()
close(aggregations)
}()

if a.Config.Agent.RoundInterval {
// Aggregators are aligned to the agent interval regardless of
Expand All @@ -394,7 +397,6 @@ func (a *Agent) runAggregators(
acc := NewAccumulator(agg, aggregations)
acc.SetPrecision(precision, interval)
a.push(ctx, agg, acc)
close(aggregations)
}(agg)
}

Expand Down

0 comments on commit 88ff858

Please sign in to comment.