wu-sheng commented on code in PR #700:
URL: https://github.com/apache/skywalking-java/pull/700#discussion_r1650114809


##########
apm-sniffer/apm-sdk-plugin/redisson-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/redisson/v3/RedisConnectionMethodInterceptor.java:
##########
@@ -154,8 +159,8 @@ private Optional<String> parseOperation(String cmd) {
 
     private String showBatchCommands(CommandsData commandsData) {
         return commandsData.getCommands()
-                           .stream()
-                           .map(data -> data.getCommand().getName())
-                           .collect(Collectors.joining(";"));
+                        .stream()
+                        .map(data -> data.getCommand().getName())
+                        .collect(Collectors.joining(";"));

Review Comment:
   These seem unnecessary.



##########
apm-sniffer/apm-sdk-plugin/redisson-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/redisson/v3/RedisConnectionMethodInterceptor.java:
##########
@@ -93,17 +96,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 {
-        ContextManager.stopSpan();
+    public Object afterMethod(EnhancedInstance objInst, Method method, 
Object[] allArguments, Class<?>[] argumentsTypes, Object ret, 
MethodInvocationContext context) throws Throwable {
+        if (Objects.nonNull(context.getContext())) {
+            ContextManager.stopSpan();
+        }
         return ret;
     }
 
     @Override
-    public void handleMethodException(EnhancedInstance objInst, Method method, 
Object[] allArguments,
-        Class<?>[] argumentsTypes, Throwable t) {
-        AbstractSpan span = ContextManager.activeSpan();
-        span.log(t);
+    public void handleMethodException(EnhancedInstance objInst, Method method, 
Object[] allArguments, Class<?>[] argumentsTypes, Throwable t, 
MethodInvocationContext context) {
+        if (ContextManager.isActive()) {

Review Comment:
   You should use flag here as well.



-- 
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]

Reply via email to