Open denis111 opened 3 years ago
If i change .fromFuture(calculateAsync()) to .fromCallable(() -> calculateAsync().get()) then it works fine
I think that is the way to go. Using fromFuture
you would have to make sure the thread pool is instrumented
@graemerocher yes, I already changed everything in my "real" project to fromCallable. But with flowable it worked fine, the CompletableFuture there is not mine but returned by a third party library.
so in general as part of the shift to reactor we need to rewrite the instrumentation logic in reactor to use the context https://projectreactor.io/docs/core/release/api/reactor/util/context/Context.html
This work is not undertaken yet but will solve the issue you see for Reactor in the future
@graemerocher ok, thank you! I'll just use fromCallable for now.
@dstepanov this still an issue after your changes?
We notice a similar issue with Mono response which we notice only occurs when the runtime is jetty or azure_function but for netty, it works fine. Are there any updates on the issue?
When using project Reactor flow ServerRequestContext is lost when Mono is created by Mono.fromFuture. Here's the example code (i think it's too small to publish on github):
If you go to /context/flowable it's ok, context present but in /context/flux not.
Task List
Steps to Reproduce
Expected Behaviour
The output should be Hello ok
Actual Behaviour
The output is Hello nok
Environment Information