wu-sheng commented on code in PR #667:
URL: https://github.com/apache/skywalking-java/pull/667#discussion_r1460428670
##########
apm-sniffer/apm-sdk-plugin/redisson-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/redisson/v3/RedissonHighLevelLockInterceptor.java:
##########
@@ -48,7 +50,19 @@ public void beforeMethod(EnhancedInstance objInst, Method
method, Object[] allAr
@Override
public Object afterMethod(EnhancedInstance objInst, Method method,
Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable {
+ AbstractSpan span = ContextManager.activeSpan();
+ span.prepareForAsync();
ContextManager.stopSpan();
+
+ RFuture<Object> future = (RFuture) ret;
+ CompletableFuture<Object> completableFuture =
future.toCompletableFuture();
+ completableFuture.whenCompleteAsync((res, ex) -> {
Review Comment:
AFAIK, as you picked `#whenCompleteAsync`, you can't guarantee the given
execution(`span#asyncFinish`) called in time. The execution time could be
longer than expected.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]