-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatibility with Spring Cloud Sleuth can cause "Inconsistent state! tracer != last tracer errors" #1076
Comments
Will consider as a future agent roadmap item/for a future quarter |
Note : This situation may still occur, even when Spring Cloud Sleuth is disabled, so consider alternate ways this same behavior could be triggered |
It looks like it is still something Spring related. In the latest logs I see this tracer for
|
Likely related to either the |
Hello do you have any updates on this ticket? |
I have similar issue without Sleuth.
|
The Java agent does not currently support Spring Cloud Sleuth and using it can cause a clash with Java agent instrumentation that leads to the following
Inconsistent state! tracer != lastTracer
errors.For context, this issue occurs when the agent is handling some async activity and is adding tracers for each method call and popping tracers off the stack as each method call completes. The agent tracks what the first tracer (root tracer) is when the async activity started and by the end we would expect that that last tracer we pop off should be the root, but in this case it isn't, which means that the agent has lost track of the correct call stack into this async code. When the pointer to the tracer object at the top of the stack differs from the actual tracer object that gets popped off then the agent is in an inconsistent state. If this happens the agent discards the async information it was attempting to record and logs the inconsistent state error.
A separate PR adds extra debug logging to the agent to help troubleshoot such issues. #1066
Here is some analysis of such debug logging (note that the logging will change slightly when PR #1066 is merged):
So what causes
DefaultTracer@53f2914f
to incorrectly point toNoOpTracer@1d1a05c7
??? Somehow this is the result that is returned when calling tracer.getParentTracer onDefaultTracer@53f2914f
.Here's info about DefaultTracer@53f2914f:
It appears to be an incompatibility with Spring Cloud Slueth? Likely the
SpanCustomizingAsyncHandlerInterceptor
is causing the agent to lose track of the active transaction, thus leading to the creation of aNoOpTracer
.Until Spring Cloud Sleuth is properly supported the options are:
Inconsistent state
errorThe text was updated successfully, but these errors were encountered: