Skip to content

Commit 61706a3

Browse files
dinalDina Nimrodi
and
Dina Nimrodi
authored
fix metric.lock race (#544) (#545)
Co-authored-by: Dina Nimrodi <[email protected]> Co-authored-by: Dina Nimrodi <[email protected]>
1 parent b7d3520 commit 61706a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: pkg/appender/appender.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ func (mc *MetricsCache) addMetric(hash uint64, name string, metric *MetricState)
186186
// Push append to async channel
187187
func (mc *MetricsCache) appendTV(metric *MetricState, t int64, v interface{}) {
188188
metric.Lock()
189-
defer metric.Unlock()
190189
metric.store.numNotProcessed++
190+
metric.Unlock()
191191
mc.asyncAppendChan <- &asyncAppend{metric: metric, t: t, v: v}
192192
}
193193

0 commit comments

Comments
 (0)