You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`CreateChild` adds a new span to the current span's list of children. `CreateAsyncChild` calls `CreateChild`, then sets the isAsync bool on the span. This can lead to a race caused by simultaneous read of the child span's `isAsync` bool by `Send` as it's being written by `CreateAsyncChild`. To fix this, I refactored the code a bit to allow us to set `isAsync` before the span is added to the list of child spans.
This doesn't seem to be the same race reported in #38 but it should be fixed either way.
Fixes#38 - if `Send` is called for a span and its parent at the same time, a race can occur when accesing "isSent". This adds a lock to `Send`, which sets `isSent` and protects reads with read locks. This also effectively prevents `Send` from executing multiple times for the same span.
While running some tests with the race detector enabled, we noticed the following data race in the
Span
'sSend
method:I am using the latest master of libhoney-go (a6839afb6be6f3ec9de43b3a2c08f89b338e8534) and beeline-go (87bb646).
These lines correspond to the following code
It's not clear exactly what happened to me, but perhaps if a parent span is sent at the same time as one of its children it could lead to this race?
The text was updated successfully, but these errors were encountered: