Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[trace] Fix race between CreateAsyncChild and span.Send
`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.
- Loading branch information