We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.72.1
1.24.0
Lately we're seeing data race errors in our logs.
Read:
dd-trace-go/ddtrace/tracer/tracer.go
Line 687 in 94c7f0e
Write:
dd-trace-go/ddtrace/tracer/span.go
Line 405 in 94c7f0e
The write side seems to have a lock from here:
Lines 117 to 118 in 94c7f0e
My guess is that applyPPROFLabels is missing localRootSpan.RLock()? Should I send a pull request that would add it?
applyPPROFLabels
localRootSpan.RLock()
No response
The text was updated successfully, but these errors were encountered:
Thanks for reporting this issue! I can reproduce this with this test:
func TestPPROFLabelRootSpanRace(t *testing.T) { tracer, _, _, stop := startTestTracer(t) defer stop() parent := tracer.StartSpan("parent") var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() for i := 0; i < 1000; i++ { tracer.StartSpan("child", ChildOf(parent.Context())) } }() wg.Add(1) go func() { defer wg.Done() for i := 0; i < 1000; i++ { parent.SetTag(ext.ResourceName, "x") } }() wg.Wait() }
Taking a read lock on the parent span makes sense to me as a fix. Please feel free to send a PR :)
Sorry, something went wrong.
darccio
Successfully merging a pull request may close this issue.
Tracer Version(s)
1.72.1
Go Version(s)
1.24.0
Bug Report
Lately we're seeing data race errors in our logs.
Read:
dd-trace-go/ddtrace/tracer/tracer.go
Line 687 in 94c7f0e
Write:
dd-trace-go/ddtrace/tracer/span.go
Line 405 in 94c7f0e
The write side seems to have a lock from here:
dd-trace-go/ddtrace/tracer/span.go
Lines 117 to 118 in 94c7f0e
My guess is that
applyPPROFLabels
is missinglocalRootSpan.RLock()
? Should I send a pull request that would add it?Reproduction Code
No response
Error Logs
No response
Go Env Output
No response
The text was updated successfully, but these errors were encountered: