Skip to content

Commit fceaf98

Browse files
committed
address comments
1 parent 885da03 commit fceaf98

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sdk/trace/batch_span_processor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ func NewBatchSpanProcessor(exporter SpanExporter, options ...BatchSpanProcessorO
139139
return bsp
140140
}
141141

142-
var processorID atomic.Int64
142+
var processorIDCounter atomic.Int64
143143

144144
// nextProcessorID returns an identifier for this batch span processor,
145145
// starting with 0 and incrementing by 1 each time it is called.
146146
func nextProcessorID() int64 {
147-
return processorID.Add(1) - 1
147+
return processorIDCounter.Add(1) - 1
148148
}
149149

150150
// configureSelfObservability configures metrics for the batch span processor.

sdk/trace/batch_span_processor_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"encoding/binary"
99
"errors"
1010
"fmt"
11+
"runtime"
1112
"sync"
1213
"sync/atomic"
1314
"testing"
@@ -872,7 +873,7 @@ func (e *blockingExporter) ExportSpans(ctx context.Context, s []ReadOnlySpan) er
872873

873874
func (e *blockingExporter) waitForSpans(n int32) {
874875
// Wait for all n spans to reach the export call
875-
// nolint: revive // intentionally empty block
876876
for e.total.Load() < n {
877+
runtime.Gosched()
877878
}
878879
}

0 commit comments

Comments
 (0)