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

Scope Manager: Should it return Noop-types for Scope.active / Tracer.activeSpan? #116

@cwe1ss

Description

@cwe1ss

Java has recently merged opentracing/opentracing-java#263 (and the same change is pending in C# (opentracing/opentracing-csharp#84)) which changes the behavior of the NoopTracer: It will now always return NoopScope.INSTANCE and NoopSpanImpl.INSTANCE instead of null values.

However, if people rely on these methods to never return null then this will violate the current "Scope Manager" RFC (see quote below) and it will ultimately lead to null pointer exceptions when people switch from a NoopTracer to a real tracer.

active, the Scope containing the current active Span if any, or else null/nothing.

Did I misinterpret this risk? If not, should we revert this change in Java or should we change the RFC to state that ALL scope managers should return Noop-types for Scope.active and Tracer.activeSpan?

/cc @carlosalberto (author of the RFC)
/cc @natehart @yurishkuro (people who contributed to the Java PR)
/cc @MikeGoldsmith (people wo contributed to the C# PR)

PS: @carlosalberto the RFC currently doesn't mention the convenience accessor Tracer.activeSpan - should it be added to the RFC?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions