You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/05/20 03:55:37 UTC

[GitHub] [skywalking] lujiajing1126 commented on a change in pull request #6973: Fix ClassCast issue for RequestHolder/ResponseHolder

lujiajing1126 commented on a change in pull request #6973:
URL: https://github.com/apache/skywalking/pull/6973#discussion_r635734142



##########
File path: apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/InvokeInterceptor.java
##########
@@ -57,11 +61,12 @@ public Object afterMethod(final EnhancedInstance objInst,
                               final Object ret) throws Throwable {
         ServerWebExchange exchange = (ServerWebExchange) allArguments[0];
         return ((Mono) ret).doFinally(s -> {
-            ReactiveResponseHolder responseHolder = (ReactiveResponseHolder) objInst.getSkyWalkingDynamicField();
-            AbstractSpan span = responseHolder.getSpan();
-            if (span == null) {
+            CrossThreadRefContainer container = (CrossThreadRefContainer) objInst.getSkyWalkingDynamicField();
+            Object ref = container.getRef();
+            if (!(ref instanceof AbstractSpan)) {

Review comment:
       > Why instanceof rather than not null?
   
   Removed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org