Skip to content

Commit fb8ecca

Browse files
authored
[chore] [processor/memorylimiter] Fix data race in a test (#7561)
1 parent 8e33ded commit fb8ecca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

processor/memorylimiterprocessor/internal/mock_exporter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (e *MockExporter) ConsumeLogs(_ context.Context, ld plog.Logs) error {
5151
func (e *MockExporter) SetDestAvailable(available bool) {
5252
if available {
5353
// Pretend we delivered all queued accepted logs.
54-
atomic.AddInt64(&e.deliveredLogCount, e.acceptedLogCount)
54+
atomic.AddInt64(&e.deliveredLogCount, atomic.LoadInt64(&e.acceptedLogCount))
5555

5656
// Get rid of the delivered logs so that memory can be collected.
5757
e.Logs = nil

0 commit comments

Comments
 (0)