Skip to content

Commit

Permalink
Fix data race between kafkareceiver and batchprocessor (#2956) (#2957)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjm authored Apr 19, 2021
1 parent 90b2dec commit 4e1fd23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion receiver/kafkareceiver/kafka_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ func (c *consumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession,
return err
}

spanCount := traces.SpanCount()
err = c.nextConsumer.ConsumeTraces(session.Context(), traces)
obsreport.EndTraceDataReceiveOp(ctx, c.unmarshaller.Encoding(), traces.SpanCount(), err)
obsreport.EndTraceDataReceiveOp(ctx, c.unmarshaller.Encoding(), spanCount, err)
if err != nil {
return err
}
Expand Down

0 comments on commit 4e1fd23

Please sign in to comment.