提交 18d2d352 编写于 作者: C caoyixiong 提交者: wu-sheng

Fix bug stop stopSpan when not createSpan in Spring Callback (#1572)

* Fix bug stop stopSpan when not createSpan
上级 46c0e76e
......@@ -51,12 +51,20 @@ public class FailureCallbackInterceptor implements InstanceMethodsAroundIntercep
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField();
if (cacheValues == null) {
return ret;
}
ContextManager.stopSpan();
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField();
if (cacheValues == null) {
return;
}
ContextManager.activeSpan().errorOccurred().log(t);
}
}
......@@ -51,12 +51,20 @@ public class SuccessCallbackInterceptor implements InstanceMethodsAroundIntercep
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField();
if (cacheValues == null) {
return ret;
}
ContextManager.stopSpan();
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField();
if (cacheValues == null) {
return;
}
ContextManager.activeSpan().errorOccurred().log(t);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册