You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/03/28 07:48:58 UTC

[GitHub] [rocketmq] Git-Yang edited a comment on issue #4033: [ScheduleMessage] Async deliver message will resend forever when service not avaliable

Git-Yang edited a comment 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. Resending is via putMessage(), so Futrues are not infinitely nested.
   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-unsubscribe@rocketmq.apache.org

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