Skip to content
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: fix a race condition on span.SetUser #1564

Merged
merged 5 commits into from
Mar 27, 2023

Conversation

pobo380
Copy link
Contributor

@pobo380 pobo380 commented Nov 3, 2022

What does this PR do?

  • Add check for finished flag on span.SetUser.
  • Modify the test case to detect the race condition.

Motivation

  • To avoid a race condition on span.SetUser.
  • My project is experiencing crashes due to this issue. I would be happy to have it merged and released as soon as possible. 🥺

Describe how to test/QA your changes

  • Run TestSpanModifyWhileFlushing with -race flag.
  • I believe the existing test cases cover the fact that this change has not caused any regression.

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Changed code has unit tests for its functionality.
  • If this interacts with the agent in a new way, a system test has been added.

@pobo380 pobo380 force-pushed the fix-race-condition-on-set-user branch from 18227d0 to 9097dc8 Compare November 3, 2022 14:08
@pobo380 pobo380 force-pushed the fix-race-condition-on-set-user branch from 9097dc8 to a6929ea Compare November 3, 2022 14:09
@pobo380 pobo380 marked this pull request as ready for review November 3, 2022 14:09
@pobo380 pobo380 requested a review from a team November 3, 2022 14:09
Copy link
Contributor

@lievan lievan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR strengthens the TestSpanModifyingWhileFlushing test case and fixes a race condition - looks good to me and thanks!

@lievan lievan added this to the v1.47.0 milestone Jan 24, 2023
@dianashevchenko dianashevchenko modified the milestones: v1.47.0, v1.48.0 Feb 1, 2023
@Hellzy Hellzy modified the milestones: v1.48.0, v1.49.0 Feb 27, 2023
@nadavshatz
Copy link

This hit us in production as well - can we get this merged and a release cut please?

@ahmed-mez ahmed-mez merged commit 5b4118f into DataDog:main Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants