opentracing / specification

A place to document (and discuss) the OpenTracing specification. 🛑 This project is DEPRECATED! https://github.com/opentracing/specification/issues/163
http://opentracing.io/spec
Apache License 2.0
1.17k stars 182 forks source link

Clarify thread-safety of Span #115

Open raskam opened 6 years ago

raskam commented 6 years ago

Background

I was not able to find any notes on thread-safety of Span in the Specification, nor in opentracing-java.

Problem

I'm not sure if I could use single Span instance in a concurrent environment. When discussed on Gitter with @jpkrohling, he said he would expect it to be thread-safe, but in practice it is probably implementation-specific as thread-safety it not explicitly addressed in the Specification.

Considering operations from opentracing-java

For other Data Models I've found that

Proposal

Clarify in the specification, whether OpenTracing implementations should (or must) implement Span and it's operations in a thread-safe manner. And vice versa, if thread-safety is intentionally implementation dependent, it should be mentioned in the docs (or opentracing-java at least)

Thanks!

isaachier commented 6 years ago

SpanContext cannot be immutable in C++ due to https://github.com/opentracing/opentracing-cpp/issues/74. I changed Jaeger client to use locking there.

carlosalberto commented 6 years ago

Now being discussed in #120 ;)