-
Notifications
You must be signed in to change notification settings - Fork 240
Fix race condition on GetSpan and guard transport Close #1044
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1044 +/- ##
==========================================
+ Coverage 86.70% 86.75% +0.04%
==========================================
Files 55 55
Lines 5799 5804 +5
==========================================
+ Hits 5028 5035 +7
+ Misses 629 627 -2
Partials 142 142 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@sentry review |
On it! We are reviewing the PR and will provide feedback shortly. |
PR DescriptionThis pull request addresses two main issues: thread safety in accessing the Click to see moreKey Technical Changes
Architecture DecisionsThe architectural decisions involve using standard Go concurrency primitives ( Dependencies and InteractionsThese changes primarily affect the internal workings of the Risk ConsiderationsThe addition of mutexes in Notable Implementation DetailsThe use of |
transport_test.go
Outdated
case <-transport.done: | ||
// Expected - channel should be closed | ||
case <-time.After(time.Second): | ||
t.Fatal("tranposrt.done not closed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Fatal("tranposrt.done not closed") | |
t.Fatal("transport.done not closed") |
transport.go
Outdated
@@ -303,7 +303,8 @@ type HTTPTransport struct { | |||
// current in-flight items and starts a new batch for subsequent events. | |||
buffer chan batch | |||
|
|||
start sync.Once | |||
start sync.Once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l
: is naming things <something>Once
a convention in go? Then maybe we could rename this to startOnce
also for consistency between the two (could also be done in a separate PR though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda is. Makes sense will change for consistency.
Partial fix for #1047.
Description
done
channel once, to avoid panics.