Skip to content

Commit

Permalink
fix(inputs.influxdb_v2_listener): Fix concurrent read/write dict
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsStegman committed Oct 7, 2024
1 parent 40d7961 commit e44c461
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/inputs/influxdb_v2_listener/influxdb_v2_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ func (h *InfluxDBV2Listener) Start(acc telegraf.Accumulator) error {
case <-h.ctx.Done():
return
case info := <-h.trackingAcc.Delivered():
h.countLock.Lock()
if count, ok := h.trackingMetricCount[info.ID()]; ok {
h.countLock.Lock()
h.totalUndeliveredMetrics.Add(-count)
delete(h.trackingMetricCount, info.ID())
h.countLock.Unlock()
}
h.countLock.Unlock()
}
}
}()
Expand Down

0 comments on commit e44c461

Please sign in to comment.