-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple NewTracerProvider
calls with the same batcher cause data race
#3755
Labels
bug
Something isn't working
Comments
SOF3
changed the title
cenkalti/backoff.ExponentialBackoff is not thread-safe
Multiple Feb 20, 2023
NewTracerProvider
calls with the same batcher causes data race
SOF3
changed the title
Multiple
Multiple Feb 20, 2023
NewTracerProvider
calls with the same batcher causes data raceNewTracerProvider
calls with the same batcher cause data race
Thank you for reporting this. I have opened a fix in #3756. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
It is clearly documented that
ExponentialBackoff
is not thread-safe:https:/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: