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/08/08 15:17:55 UTC

[GitHub] [rocketmq] ShannonDing commented on a diff in pull request #4655: [ISSUE #4654] Use the scheduleWithFixedDelay instead of creating unnecessary DeliverDelayedMessageTimerTask and HandlePutResultTask objects

ShannonDing commented on code in PR #4655:
URL: https://github.com/apache/rocketmq/pull/4655#discussion_r940364353


##########
broker/src/main/java/org/apache/rocketmq/broker/schedule/ScheduleMessageService.java:
##########
@@ -398,7 +398,12 @@ public void run() {
             } catch (Exception e) {
                 // XXX: warn and notify me
                 log.error("ScheduleMessageService, executeOnTimeup exception", e);
-                this.scheduleNextTimerTask(this.offset, DELAY_FOR_A_PERIOD);
+                try {
+                    // Wait for a period of time if an error has occurred.
+                    TimeUnit.MILLISECONDS.sleep(DELAY_FOR_A_PERIOD);
+                } catch (InterruptedException ignored) {
+                    // ignored

Review Comment:
   it is better print the log here, although the process may not come here.



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