Multiple NewTracerProvider
calls with the same batcher cause data race
#3755
Labels
bug
Something isn't working
Description
It is clearly documented that
ExponentialBackoff
is not thread-safe:https://github.com/cenkalti/backoff/blob/a214dad550bb72db341d655094a496034bbf7e0a/exponential.go#L52
However it is used in retry.go:
opentelemetry-go/exporters/otlp/internal/retry/retry.go
Line 105 in ecf0838
The value
b
is scoped atRequestFunc
instead of the returned closure. Reuse of the returned closure in multiple goroutines results in data race. TheRequestFunc
return value is used inopentelemetry-go/exporters/otlp/otlptrace/otlptracegrpc/client.go
Line 200 in ecf0838
It is not documented anywhere that
otelsdktrace.WithBatcher
shall not be called more than once on the same exporter.Environment
Steps To Reproduce
Compile with
go run -race
, create multiple new tracer providers withWithBatcher(exporter)
with the sameexporter
.Equivalent go code:
The text was updated successfully, but these errors were encountered: