From fa549154370cb866a90e37c13a90d2c598d6b1f6 Mon Sep 17 00:00:00 2001 From: yuz10 <845238369@qq.com> Date: Tue, 29 Aug 2023 15:22:09 +0800 Subject: [PATCH] [ISSUE #7261] Slave high CPU usage when enableScheduleAsyncDeliver=true (#7262) * [ISSUE #6390] Add break to the exception of WHEEL_TIMER_NOT_ENABLE. * fix broker start fail if mapped file size is 0 * log * only delete the last empty file * change dataReadAheadEnable default to true * fix endless loop when master change to slave. --- .../rocketmq/broker/schedule/ScheduleMessageService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/broker/src/main/java/org/apache/rocketmq/broker/schedule/ScheduleMessageService.java b/broker/src/main/java/org/apache/rocketmq/broker/schedule/ScheduleMessageService.java index aed0ee19fa5..297b14207c2 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/schedule/ScheduleMessageService.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/schedule/ScheduleMessageService.java @@ -566,7 +566,8 @@ public void run() { pendingQueue.remove(); break; case RUNNING: - break; + scheduleNextTask(); + return; case EXCEPTION: if (!isStarted()) { log.warn("HandlePutResultTask shutdown, info={}", putResultProcess.toString()); @@ -586,6 +587,10 @@ public void run() { } } + scheduleNextTask(); + } + + private void scheduleNextTask() { if (isStarted()) { ScheduleMessageService.this.handleExecutorService .schedule(new HandlePutResultTask(this.delayLevel), DELAY_FOR_A_SLEEP, TimeUnit.MILLISECONDS);