Properly clears the scopes (#2280)
without this fix when calling `maybeScope(null)` or `withSpan(null)` or `newScope(null)` we ended up with creating a null scope that would allocate additional resources and not clear things. with this fix we're clearing all the scopes and removing thread locals
This commit is contained in:
committed by
GitHub
parent
d05059a106
commit
3d198306ea
@@ -94,6 +94,13 @@ public interface CurrentTraceContext {
|
||||
*/
|
||||
interface Scope extends Closeable {
|
||||
|
||||
/**
|
||||
* Noop instance.
|
||||
*/
|
||||
Scope NOOP = () -> {
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
void close();
|
||||
|
||||
|
||||
@@ -170,6 +170,13 @@ public interface Tracer extends BaggageManager {
|
||||
*/
|
||||
interface SpanInScope extends Closeable {
|
||||
|
||||
/**
|
||||
* Noop instance.
|
||||
*/
|
||||
SpanInScope NOOP = () -> {
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
void close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user