onError & onComplete should reuse span from ThreadLocal

we've played around with the working M7 version, and only after rolling back the changes on wrapping of onError and onComplete with try-with-resources, did we manage to successfully propagate the span context to various places.

    fixes gh-973
This commit is contained in:
Marcin Grzejszczak
2018-05-16 17:26:11 +02:00
parent 4d9a7e311f
commit daff0a358c

View File

@@ -83,15 +83,11 @@ final class ScopePassingSpanSubscriber<T> extends AtomicBoolean implements SpanS
}
@Override public void onError(Throwable throwable) {
try (Tracer.SpanInScope inScope = this.tracer.withSpanInScope(this.span)) {
this.subscriber.onError(throwable);
}
this.subscriber.onError(throwable);
}
@Override public void onComplete() {
try (Tracer.SpanInScope inScope = this.tracer.withSpanInScope(this.span)) {
this.subscriber.onComplete();
}
this.subscriber.onComplete();
}
@Override public Context currentContext() {