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: Clone scope.Context in multiple places to avoid concurrent reads/writes #638

Merged
merged 6 commits into from
Jun 14, 2023

Conversation

tonyo
Copy link
Contributor

@tonyo tonyo commented May 11, 2023

Fixes #570

Here we introduce cloneContext that should be used in multiple places to avoid issues like in #570.

Note: cloneContext does not do a deep copy of Context values (which are of type interface{}), so there are cases where it's still possible to catch panics if you do weird things with Context values. But this, I believe, is out of scope of the SDK responsibility.

@tonyo tonyo requested a review from cleptric May 11, 2023 12:22
@tonyo tonyo self-assigned this May 11, 2023
@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.05 ⚠️

Comparison is base (eec094e) 79.72% compared to head (cb73fed) 79.67%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #638      +/-   ##
==========================================
- Coverage   79.72%   79.67%   -0.05%     
==========================================
  Files          38       38              
  Lines        3896     3902       +6     
==========================================
+ Hits         3106     3109       +3     
- Misses        681      683       +2     
- Partials      109      110       +1     
Impacted Files Coverage Δ
scope.go 91.12% <100.00%> (+0.21%) ⬆️
tracing.go 89.43% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

scope.go Show resolved Hide resolved
@tonyo tonyo merged commit 513eb10 into master Jun 14, 2023
@tonyo tonyo deleted the tonyo/fix-concurrent-panic-1-device-context branch June 14, 2023 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"fatal error: concurrent map writes" when submitting transaction
2 participants