caigy commented on code in PR #4655:
URL: https://github.com/apache/rocketmq/pull/4655#discussion_r940826980
##########
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 ex) {
+ log.error("ScheduleMessageService, an error occurred while
waiting", ex);
Review Comment:
IMO interrupted flag should be restored
(`Thread.currentThread().interrupt()`) after `InterruptedException` is thrown.
--
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]