yuz10 opened a new issue, #7261:
URL: https://github.com/apache/rocketmq/issues/7261

   ### Before Creating the Bug Report
   
   - [X] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [X] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [X] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   ubuntu 
   
   ### RocketMQ version
   
   5.1.0
   
   ### JDK Version
   
   1.8.0
   
   ### Describe the Bug
   
   1、set enableScheduleAsyncDeliver=true
   2、send some scheduled messages of each delay level.
   3、pause master node for a while,  the master will switch to slave. One way 
to pause is using remote debug.
   4、after the master switch to slave, resume the slave, then CPU is high.
   
   the stack is in:
   [ScheduleMessageService.java: 
561](https://github.com/apache/rocketmq/blob/develop/broker/src/main/java/org/apache/rocketmq/broker/schedule/ScheduleMessageService.java#L561C1-L562C1)
   
   when master swith to slave, deliverExecutorService shuts down, 
this.future.thenAccept is not excuted, so the task is always RUNNING, causing 
endless loop in line 561 and line 569
   
   ### Steps to Reproduce
   
   1、set enableScheduleAsyncDeliver=true
   2、send some scheduled messages of each delay level.
   3、pause master node for a while,  the master will switch to slave. One way 
to pause is using remote debug.
   4、after the master switch to slave, resume the slave, then CPU is high.
   
   ### What Did You Expect to See?
   
   CPU is normal
   
   ### What Did You See Instead?
   
   CPU usage is high
   
   ### Additional Context
   
   _No response_


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