Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Clarify thread-safety of Span #115

Open
raskam opened this issue Apr 20, 2018 · 2 comments
Open

Clarify thread-safety of Span #115

raskam opened this issue Apr 20, 2018 · 2 comments
Assignees

Comments

@raskam
Copy link

raskam commented Apr 20, 2018

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

  • I guess the Span#finish operation can be thought of as thread-safe as it should be called only once
  • I'm not sure about other operations (Span#log, Span#setTag etc.)

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
Copy link

SpanContext cannot be immutable in C++ due to opentracing/opentracing-cpp#74. I changed Jaeger client to use locking there.

@carlosalberto carlosalberto self-assigned this May 18, 2018
@carlosalberto
Copy link
Contributor

Now being discussed in #120 ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants