You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/05/31 07:54:52 UTC

[GitHub] [skywalking] zhaoyuguang opened a new pull request #2796: Fix lettuce AsyncCommand::onComplete bug

zhaoyuguang opened a new pull request #2796: Fix lettuce AsyncCommand::onComplete bug
URL: https://github.com/apache/skywalking/pull/2796
 
 
   Please answer these questions before submitting pull request
   
   - Why submit this pull request?
   - [x] Bug fix
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   https://github.com/apache/skywalking/issues/2790
   ___
   ### Bug fix
   - Bug description.
   There are three exceptions
   
   ###### 1.ClassCastException
   ```
   ERROR 2019-05-30 19:31:32:153 lettuce-nioEventLoop-4-3 InstMethodsInterWithOverrideArgs : class[class io.lettuce.core.protocol.AsyncCommand] before method[onComplete] intercept failure
   java.lang.ClassCastException: io.lettuce.core.protocol.CommandExpiryWriter$$Lambda$833/818080089 cannot be cast to java.util.function.Consumer
           At org.apache.skywalking.apm.plugin.lettuce.v5.AsyncCommandMethodInterceptor.beforeMethod(AsyncCommandMethodInterceptor.java:45)
   ```
   ![image](https://user-images.githubusercontent.com/10150229/58690296-cc3a3300-83bb-11e9-8abc-635ad2db6b95.png)
   This exception is also the exception of this pr repair: because AsyncCommand::onComplete is polymorphic, it can be Consumer or BiConsumer, originally only wrote Consumer, so there is a cast exception, the repair process is that I have to divide the Consumer or BiConsumer, Logic is handled separately.
   
   ###### 2.NullPointerException
   ```
   ERROR 2019-05-30 19:31:32:155 lettuce-nioEventLoop-4-3 InstMethodsInter : class[class io.lettuce.core.protocol.DefaultEndpoint] before method[writeToChannelAndFlush] intercept failure
   java.lang.NullPointerException
           At org.apache.skywalking.apm.plugin.lettuce.v5.RedisChannelWriterInterceptor.beforeMethod(RedisChannelWriterInterceptor.java:62)
   ```
   Because the peer will be lost in some cases, I have fixed this pr https://github.com/apache/skywalking/pull/2621
   ###### 3.IllegalStateException
   ```
   ERROR 2019-05-30 19:31:32:158 lettuce-nioEventLoop-4-3 InstMethodsInter : class[class io.lettuce.core.protocol.DefaultEndpoint] after method[writeToChannelAndFlush] intercept failure
   java.lang.IllegalStateException: No active span.
           At org.apache.skywalking.apm.agent.core.context.TracingContext.activeSpan(TracingContext.java:382)
           At org.apache.skywalking.apm.agent.core.context.ContextManager.activeSpan(ContextManager.java:161)
           At org.apache.skywalking.apm.agent.core.context.ContextManager.stopSpan(ContextManager.java:165)
           At org.apache.skywalking.apm.plugin.lettuce.v5.RedisChannelWriterInterceptor.afterMethod(RedisChannelWriterInterceptor.java:72)
   ```
          The reason is the same as 2, because before is exception, so afterMethod reporting this error
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services