Closed fredalxin closed 7 months ago
Firstly please try with the latest version, we are not going to provide any fixes for old versions such as v1.25.0
. Secondly please provide a minimal sample application with instructions necessary for reproducing the issue.
This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed automatically if there is no response from the author within 7 additional days from this comment.
Describe the bug
I am using Spring Cloud Gateway and implemented a custom GlobalFilter.
In my PropagateUtils method, I have implemented the
extract()
andinject()
methods. Specifically in the extract() method, I added a custom value.I issued a request using curl, which included the header "baggage: key=v2". However, evidently, after the above code, the "baggage" value in both my request header and context changed to "key=v1". The issue arises when, after the code interception by Netty, mainly
HttpClientRequestTracingHandler
, there are some problems with context.For the first request, the context it obtained is empty, so it does not call
W3CBaggagePropagator
's inject() method, thus everything goes as planned. However, by the second request, the obtained context has become "baggage: key=v2", and thus, my header gets polluted.Even more strangely, when I set some breakpoints in HttpServerResponseTracingHandler and HttpServerRequestTracingHandler, the next request returns to normal. So perhaps, in some scenarios, the code does not correctly clear the context or the channel's attribute (attr).
Steps to reproduce
Expected behavior
header should be "key=v1"
Actual behavior
header is "key=v2"
Javaagent or library instrumentation version
v1.25.0
Environment
JDK: 1.8 OS: macos
Additional context
No response