qxo edited a comment on issue #3065: Propose a API change : 
AbstractTracerContext#asyncStop and AsyncSpan#asyncFinish return boolean
URL: https://github.com/apache/skywalking/pull/3065#issuecomment-511099979
 
 
   我发现问题点了,代码调用顺序如下调整可以发送数据到skywalking系统。
   ```
          span.prepareForAsync();
           Thread.sleep(3l);
           span.asyncFinish();  
           Thread.sleep(1l);
           ContextManager.stopSpan(span); 
   ```
   **must invoke ContextManager.stopSpan to close then span**
   
个人建议如果的话尽能使用`ContextManager.stopSpan(span)`方式来关闭span:关闭顺序如果不对可直接报错,能做到fail-fast
   
   
   另外关于API 健壮性:我主要指定的是目前实现一个span可以被多调次asyncStop, 
如能限制一个span只能调用一次stop(或只有第一次调用能有附加影响:能改程序状态),那就是基上能防止:“因plugin A的bug而导致之后的plugin 
B功能不正常" --  不过,这是另外一个问题

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to