Closed Danny02 closed 4 years ago
It is the same thing with Mono.fromRunnable. The problem is easy to spot:
@Override
public void subscribe(CoreSubscriber<? super T> actual) {
MonoRunnableEagerSubscription s = new MonoRunnableEagerSubscription();
actual.onSubscribe(s);
if (s.isCancelled()) {
return;
}
try {
run.run();
actual.onComplete();
} catch (Throwable ex) {
actual.onError(Operators.onOperatorError(ex, actual.currentContext()));
}
}
actual.onSubscribe(s);
opens and closes the scope of the active span, but run.run() is called after it.
I guess it is the same problem with Mono.create
This is probably related to https://github.com/opentracing-contrib/java-reactor/issues/3 where it's an issue with the executors. Did you register the hooks manually?
Hi,
I'm using a library which tries to log to the active span from within a Mono.create block. The TracerSubscriber does not seem to set the active span for this case.