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 2018/08/17 02:52:12 UTC

[GitHub] jinlongwang commented on issue #1549: Shadow tracing context. Thread dump error when pressure test

jinlongwang commented on issue #1549: Shadow tracing context. Thread dump error when pressure test
URL: https://github.com/apache/incubator-skywalking/issues/1549#issuecomment-413742768
 
 
   you'r right. we fixed this problem. there is something wrong with plugins. the quality of these plugins is uneven.  we found there is bug in `springmvc` plugin. here the infos:
   
   plugin: `apm-springmvc-annotation-commons` 
   package:   `org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor` 
   class: `AbstractMethodInterceptor`
   method: `afterMethod`
   line: `104`
   
   ```
       @Override
       public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
           Object ret) throws Throwable {
           Boolean forwardRequestFlag = (Boolean)ContextManager.getRuntimeContext().get(FORWARD_REQUEST_FLAG);
           /**
            * Spring MVC plugin do nothing if current request is forward request.
            * Ref: https://github.com/apache/incubator-skywalking/pull/1325
            */
           if (forwardRequestFlag != null && forwardRequestFlag) {
               return ret;
           }
   
           HttpServletResponse response = (HttpServletResponse)ContextManager.getRuntimeContext().get(RESPONSE_KEY_IN_RUNTIME_CONTEXT);
           try {
               if (response != null) {
                   AbstractSpan span = ContextManager.activeSpan();
                   if (response.getStatus() >= 400) {
                       span.errorOccurred();
                       Tags.STATUS_CODE.set(span, Integer.toString(response.getStatus()));
                   }
                   ContextManager.stopSpan();
               }
           } finally {
               ContextManager.getRuntimeContext().remove(REQUEST_KEY_IN_RUNTIME_CONTEXT);
               ContextManager.getRuntimeContext().remove(RESPONSE_KEY_IN_RUNTIME_CONTEXT);
           }
   
           return ret;
       }
   ```
   
   this statement  `ContextManager.stopSpan();` may not execute, then this problem will be be triggered.
   
   `ContextManager.stopSpan();` is very important, We think the pluginā€˜s author did not understand the meaning of this sentence.
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services