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
ddtrace/tracer: [bugfix] Atomically load error count when creating child spans #1894
Conversation
374fd5a
to
586693a
Compare
@ahmed-mez 👋 any way you can help me get this reviewed? |
…ild spans Otherwise, it's subject to a data race while concurrently creating child spans and erroring. The count is written via atomic increments.
@JDeuce Can you please share the steps to reproduce / regression test to ensure that's the fix or the only fix needed? |
In testing with a private application it did seem to resolve the race condition. I think it has to do with potentially continuing to create new child spans after |
@JDeuce Sorry for the delay here. From your latest message, it sounds like this PR doesn't fix the issue, is that correct? If that's the case, would you mind testing this with the latest dd-trace-go release and filing an issue so we can keep track of it there? Then we can close this PR and investigate the issue separately. We don't want to lose track of this issue if there is a race condition hidden somewhere. Thank you! |
Closing due to inactivity. |
What does this PR do?
The error count is written atomically but it can trigger data race when reading here if multiple child spans are created concurrently while errors are happening.
Motivation
This data race excerpt I captured as part of a larger application that does race detection while running complex unit tests on systems that create traces. Somehow it never triggered this with dd-trace-go
v1.48.0
but blocks us from updating tov1.49.1
.Describe how to test/QA your changes
Locally used a version with this patch and saw the race go away
Reviewer's Checklist