Fix the bug that httpasyncclient-4.x-plugin puts the dirty tracing context in the connection context (#86)

This commit is contained in:
Ze 2021-12-21 11:16:26 +08:00 committed by GitHub
parent 61e0e6de7b
commit 96ea77cf8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@ Release Notes.
* Add dubbo 3.x plugin.
* Fix TracePathMatcher should match pattern "**" with paths end by "/"
* Add support `returnedObj` expression for apm-customize-enhance-plugin
* Fix the bug that httpasyncclient-4.x-plugin puts the dirty tracing context in the connection context
#### Documentation

View File

@ -33,7 +33,7 @@ public class LeaseRequestCompletedInterceptor implements InstanceMethodsAroundIn
MethodInterceptResult result) throws Throwable {
PoolEntry entry = (PoolEntry) allArguments[0];
NHttpConnection conn = (NHttpConnection) entry.getConnection();
if (ContextManager.isActive()) {
if (ContextManager.isActive() && !ContextManager.activeSpan().isExit()) {
conn.getContext().setAttribute(Constants.SKYWALKING_CONTEXT_SNAPSHOT, ContextManager.capture());
conn.getContext().setAttribute(Constants.SKYWALKING_HTTP_CONTEXT, Constants.HTTP_CONTEXT_LOCAL.get());
}