1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-06-27 00:21:15 +02:00

SDK: Multiple Unregister should not trigger multiple shutdown call (#176)

* SDK: Multiple Unregister should not trigger multiple shutdown call

* fix a data race: waitGroup.Add() should be outside of a goroutine
This commit is contained in:
Artem Kartasov
2019-10-09 13:31:29 +07:00
committed by rghetia
parent be8fb0b4e2
commit ffbef6a007
3 changed files with 12 additions and 9 deletions

View File

@ -104,9 +104,9 @@ func NewBatchSpanProcessor(e export.SpanBatcher, opts ...BatchSpanProcessorOptio
//Start timer to export metrics
ticker := time.NewTicker(bsp.o.ScheduledDelayMillis)
bsp.stopWait.Add(1)
go func(ctx context.Context) {
defer ticker.Stop()
bsp.stopWait.Add(1)
for {
select {
case <-bsp.stopCh: