Closed patpatpat123 closed 2 years ago
@patpatpat123 @Bean
is not provided by Reactor Netty. Please explain why you think this is a Reactor Netty issue.
Hello @violetagg,
Thank you for looking into this. I did think about it before posting.
So I tried using @Bean
on other http clients, and none of them are emitting this cancel
signal.
This cancel signal is further shown in Zipkin, and can be intercepted by https://github.com/spring-cloud/spring-cloud-sleuth/blob/3.1.x/spring-cloud-sleuth-instrumentation/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/TraceExchangeFilterFunction.java#L293-L312)
Finally, please correct me if I am wrong here, I think it is the reactor.netty.http.client.HttpClient
which emits the cancel
even upon success.
@patpatpat123
When you declare HttpClient
as a Bean
, spring-cloud-sleuth
applies some instrumentation (see the stack below), when you do NOT declare HttpClient
as a Bean
there is no more instrumentation on the level of HttpClient
.
I cannot comment why at some point while Reactor Netty is delivering the result, a cancel signal is emitted, and whether it is related to the classes below:
org.springframework.cloud.sleuth.instrument.web.client.HttpClientBeanPostProcessor
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber
I'm closing the issue, if the problem appears in Reactor Netty we can reopen it.
Thank you @violetagg for looking into this.
I really though this was related to the Reactor HttpClient itself. Now very clear. Thank you again.
Hello Reactor Netty Team,
I wanted to start an issue observed using the reactor.netty.http.client.HttpClient
Background, the project is a Java 11 + Spring Boot 2.6.7 + Jubilee 2021.0.1, very recent as of this writing.
The issue is that
reactor.netty.http.client.HttpClient
as@Bean
will always send acancel
signal, while using it without@Bean
will not (expected)Here is the minimal sample reproducible code. I tried my best to water it down to only two classes and one pom.
Instead of attaching a zip / linking a repo, here they are, it is really just couple of files, again, 100% reproducible.
But if you really need a repo, please let me know (but it is really just those files)
the pom
The controller file
The file where the issue happens
Structure (screenshot)
Run command: A curl equivalent is ok
Case 1: the issue: (please run with )
Case 2: the good (it is really strange, jut one single line change, reproducible 100%, please run with)
The result of a cancelled versus not cancelled can further be hard proven when using Zipkin, which will visually show the usage of
@Bean
will have thiscancel
signal.I believe there is an issue there, where reactor.netty.http.client.HttpClient as
@Bean
should maybe not send the cancel signal.Thank you