Skip to content

Commit 852242b

Browse files
committed
fix: data race issue occurring when multiple goroutines concurrently write to the same span
1 parent 1bb6fbf commit 852242b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tracing.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,8 @@ func (s *Span) toEvent() *Event {
594594
}
595595

596596
func (s *Span) traceContext() *TraceContext {
597+
s.mu.Lock()
598+
defer s.mu.Unlock()
597599
return &TraceContext{
598600
TraceID: s.TraceID,
599601
SpanID: s.SpanID,

0 commit comments

Comments
 (0)