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
Calling span.SetAttributes concurrently results in fatal error: concurrent map writes
Describe what you expected:
The span does not seem thread-safe for concurrent reads and writes and it is unclear whether this is the intended behavior.
Steps to reproduce the issue:
ctx, span = tracer.Start(ctx, "test")
defer span.End()
numberOfWorkers := 100
workerIDs := []int{}
for i := 0; i < numberOfWorkers; i++ {
workerIDs = append(workerIDs, i)
}
_, err = collections.ParallelWorkerMapE(workerIDs, func(i int) (any, error) { // this is a custom method that loops over a slice and runs a function in parallel
for {
span.SetAttributes(attribute.Float64("workerID", float64(i)))
}
}, numberOfWorkers)
if !assert.NoError(t, err) {
return
}
Additional environment details (Version of Go, Operating System, etc.):
go version go1.20 linux/amd64
The text was updated successfully, but these errors were encountered:
Version of dd-trace-go
v1.59.0
Describe what happened:
Calling span.SetAttributes concurrently results in
fatal error: concurrent map writes
Describe what you expected:
The span does not seem thread-safe for concurrent reads and writes and it is unclear whether this is the intended behavior.
Steps to reproduce the issue:
Additional environment details (Version of Go, Operating System, etc.):
go version go1.20 linux/amd64
The text was updated successfully, but these errors were encountered: