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

fix: Stopping the SDK from creating DynamicSamplingContext Exception #2592

Merged
merged 11 commits into from Sep 5, 2023

Conversation

bitsandfoxes
Copy link
Contributor

@bitsandfoxes bitsandfoxes commented Sep 1, 2023

Resolves #2591

The scope did not copy the propagation context when being cloned. All scopes held a reference to the same context object.

@bitsandfoxes bitsandfoxes changed the title fix: fix: Stopping the SDK from creating DynamicSamplingContext Exception Sep 1, 2023
Copy link
Collaborator

@jamescrosswell jamescrosswell left a comment

Choose a reason for hiding this comment

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

@bitsandfoxes I'm not sure I get this. Other than adding logging (when creating the dynamic sampling context from the propagation context) what has changed here?

@bitsandfoxes
Copy link
Contributor Author

The SDK is now no longer throwing exceptions. Instead of being opinionated regarding the setter being called only once we defensively handle the dynamic sampling context creation in the getter.

@jamescrosswell
Copy link
Collaborator

The SDK is now no longer throwing exceptions. Instead of being opinionated regarding the setter being called only once we defensively handle the dynamic sampling context creation in the getter.

Ah I see, there's no setter for DynamicSamplingContext anymore...

Copy link
Collaborator

@jamescrosswell jamescrosswell left a comment

Choose a reason for hiding this comment

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

Looks good generally. I just had some questions about the SentryPropagationContext constructor but otherwise good to go I think.

src/Sentry/SentryPropagationContext.cs Outdated Show resolved Hide resolved
test/Sentry.Tests/ScopeTests.cs Show resolved Hide resolved
Copy link
Collaborator

@jamescrosswell jamescrosswell left a comment

Choose a reason for hiding this comment

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

The code itself looks good... once our CI build environment is healthy again 👍🏻

@bitsandfoxes bitsandfoxes merged commit c2a31b4 into main Sep 5, 2023
16 checks passed
@bitsandfoxes bitsandfoxes deleted the fix/dynamic-sampling-context branch September 5, 2023 12:00
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.

DynamicSamplingContext Exceptions: Attempted to set the DynamicSamplingContext but the context exists already
2 participants