qxo opened a new pull request #3065: Propose a change API: AbstractTracerContext#asyncStop and AsyncSpan#asyncFinish … URL: https://github.com/apache/skywalking/pull/3065 change API AbstractTracerContext#asyncStop and AsyncSpan#asyncFinish return boolean return true when in asyncStop do invoke finished 目的是提供能力用来判断调用是否成功调用了fishished方法 原因如下: 在调用了prepareForAsync后,而后如果是最后代码点调用asyncStop因目前asyncStop实现法中和stopSpan方法中pop last span逻辑而致没法触发fishished方法 如此时再调用stopSpan因asyncSpanCounter==0可以触发fishished方法 但如果调用asyncStop方法内已经触发fishished方法,而后直接再调用stopSpan则会再次触发fishished方法 同时也不能直接调用stopSpan(因之前调用prepareForAsync,asyncSpanCounter不为0且isRunningInAsyncMode=true,故没法触发fishished方法) 由于实际代码存在两种情况,需要调整API返回调后的结果以后判断 之后就这样调用: ``` if (!span.asyncFinish() ){ ContextManager.stopSpan(span); } ``` Please answer these questions before submitting pull request - Why submit this pull request? - [ ] Bug fix - [ ] New feature provided - [ ] Improve performance - Related issues ___ ### Bug fix - Bug description. - How to fix? ___ ### New feature or improvement - Describe the details and related test reports.
---------------------------------------------------------------- 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
