Closed bhs closed 8 years ago
... this PR has also been updated per https://github.com/opentracing/opentracing-go/pull/82.
This has been updated per https://github.com/opentracing/opentracing.github.io/pull/100 and #32
I will merge this (along with https://github.com/opentracing/opentracing-go/pull/82) tomorrow if there are no objections.
LGTM! 🚢
Well, go vet
did a good job finding some actual problems here... namely that it's bad to copy structs by value that have Mutex
es inside.
The Mutex
was there to ensure that the Baggage
accesses are concurrency-safe. Since the SpanContext
may now outlive the Span
, the easy+safe fix is to make it a pointer within Span
. Sadly this does mean that there will be more allocations.
We could create a pool for these (and that would make sense), but for now I would rather get this change in and unbreak builds that depend on basictracer-go
and opentracing-go
.
See https://github.com/opentracing/opentracing-go/pull/82 .
This change is included to show some of the ramifications of
SpanContext
for implementations and OT callers (via the examples and tests here). I'll add a few notes inline.Benchmark diffs:
I made these changes pretty casually and wonder if the huge improvements on the BaggageItems benchmarks are due to some sort of measurement error in the test itself (i.e., an invalid result).