Skip to content

Commit

Permalink
Race cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lallydd committed Nov 17, 2023
1 parent 16b607e commit 205e133
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pkg/aggregator/demultiplexer_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,9 @@ func (d *AgentDemultiplexer) flushLoop() {
if trigger.blockChan != nil {
trigger.blockChan <- struct{}{}
}
d.LogRetentions()
// automatic flush sequence
case t := <-flushTicker:
d.flushToSerializer(t, false)
d.LogRetentions()
}
}
}
Expand Down Expand Up @@ -640,6 +638,8 @@ func (d *AgentDemultiplexer) GetMetricSamplePool() *metrics.MetricSamplePool {

// TakeRetentions will Import() all retentions from its parameter and save them under its tag.
func (d *AgentDemultiplexer) TakeRetentions(retentions cache.InternRetainer, tag string) {
d.m.Lock()
defer d.m.Unlock()
if ret, ok := d.retentions[tag]; !ok {
ret = cache.NewRetainerBlock()
d.retentions[tag] = ret
Expand All @@ -648,11 +648,3 @@ func (d *AgentDemultiplexer) TakeRetentions(retentions cache.InternRetainer, tag
ret.Import(retentions)
}
}

// LogRetentions logs every retention kept.
func (d *AgentDemultiplexer) LogRetentions() {
d.log.Debug("cache.Retainer: Cache Retainers:")
for tag, retainer := range d.retentions {
d.log.Debugf("cache.Retainer: %s: %s", tag, retainer.Summarize())
}
}

0 comments on commit 205e133

Please sign in to comment.