Git-Yang commented on issue #4033:
URL: https://github.com/apache/rocketmq/issues/4033#issuecomment-1080307017


   > @HScarb Skip the message will cause message loss.
   > 
   > The root cause of this problem is the infinite recursion of handleResult().
   > 
   > PutResultProcess.thenProcess is like the below:
   > 
   > ```
   >             this.future.thenAccept(result -> {
   >                 this.handleResult(result);
   >             });
   > ```
   > 
   > The core problem is when to call the "thenAccept ".
   > 
   > If the "thenAccept" is called by the background thread(for example, in 
dledger mode, by the QuorumAckChecker) and get an error, the handleResult will 
resend the message and get a new future.
   > 
   > As the future needs to be completed one by one. At this time, the old 
future will depend on the new future to complete, and the new future depend on 
the old future too.
   > 
   > It will cause a deadlock.
   > 
   > @Git-Yang @duhengforever Please help a check.
   > 
   > The suggested solution is to use a new thread to execute the callback 
instead of in the "ack thread"(GroupCommitService or QuorumAckChecker).
   
   The handleResult will resend the message, bug not get a new future.
   I think, to avoid infinite recursion, the retry logic is no longer executed 
in onException() , but in HandlePutResultTask .


-- 
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: dev-unsubscr...@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to