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 另如再在stopSpan API实现中识别调用prepareForAsync,而没asyncFinish这种编码错误,就是更完美了-- 为了性能加条件性开关需要时,在需要时开启以便做到fail-fast
---------------------------------------------------------------- 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
