StyleTang commented on pull request #3137:
URL: https://github.com/apache/rocketmq/pull/3137#issuecomment-882542027


   @yuz10 
   Already add them back.
   
   @vongosling 
   You are right. There is a small probability before and after trace not 
atomic exist.
   If consumeMessageBefore has already been executed and the trace message has 
been sent by localDispatcher, then the system crashed, subAfter trace may be 
lost.
   
   
org.apache.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService.ConsumeRequest#run
   ```java
         if 
(ConsumeMessageConcurrentlyService.this.defaultMQPushConsumerImpl.hasHook()) {
             consumeMessageContext = new ConsumeMessageContext();
     
ConsumeMessageConcurrentlyService.this.defaultMQPushConsumerImpl.executeHookBefore(consumeMessageContext);
         }
        try {
             status = 
listener.consumeMessage(Collections.unmodifiableList(msgs), context);
         } catch (Throwable e) {
         }
     
         // System crash happen 
         if 
(ConsumeMessageConcurrentlyService.this.defaultMQPushConsumerImpl.hasHook()) {  
         
ConsumeMessageConcurrentlyService.this.defaultMQPushConsumerImpl.executeHookAfter(consumeMessageContext);
         }
   ```
   


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