You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value b is scoped at RequestFunc instead of the returned closure. Reuse of the returned closure in multiple goroutines results in data race. The RequestFunc return value is used in
SOF3
changed the title
cenkalti/backoff.ExponentialBackoff is not thread-safe
Multiple NewTracerProvider calls with the same batcher causes data race
Feb 20, 2023
SOF3
changed the title
Multiple NewTracerProvider calls with the same batcher causes data race
Multiple NewTracerProvider calls with the same batcher cause data race
Feb 20, 2023
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: