RockteMQ-AI commented on code in PR #11157:
URL: https://github.com/apache/rocketmq/pull/11157#discussion_r4056743701
##########
store/src/main/java/org/apache/rocketmq/store/timer/rocksdb/TimerMessageRocksDBStore.java:
##########
@@ -569,13 +569,12 @@ private void putMsgWithRetry(MessageExtBrokerInner msg)
throws InterruptedExcept
logError.warn("Skipping message due to unrecoverable
error. Msg: {}", msg);
return;
default:
- if (retryCount == MAX_PUT_MSG_TIMES) {
+ if (!storeConfig.isTimerEnableRetryUntilSuccess() &&
retryCount >= MAX_PUT_MSG_TIMES) {
Review Comment:
**[Warning]** When `timerEnableRetryUntilSuccess=true`, the retry loop runs
indefinitely with a fixed 100ms sleep and a warn log on every iteration. This
can generate ~600 log entries per minute during persistent failures,
potentially flooding logs and making it harder to diagnose the root cause.
Consider adding periodic logging (e.g., log every 100 retries or every 10
seconds) to reduce noise while still providing visibility. Alternatively,
exponential backoff (capped at e.g. 5s) would reduce both log volume and system
load during prolonged failures.
##########
store/src/main/java/org/apache/rocketmq/store/timer/rocksdb/TimerMessageRocksDBStore.java:
##########
@@ -560,7 +560,7 @@ private void putMsgWithRetry(MessageExtBrokerInner msg)
throws InterruptedExcept
if (null == msg) {
return;
}
- for (int retryCount = 0; !isStopped() && retryCount <=
MAX_PUT_MSG_TIMES; retryCount++) {
+ for (int retryCount = 0; !isStopped(); retryCount++) {
Review Comment:
**[Info]** `retryCount` is `int` — with unlimited retries at 100ms
intervals, it would take ~6.8 years to overflow `Integer.MAX_VALUE`. Very low
risk in practice, but using `long` would be more defensive for a loop that is
explicitly designed to run indefinitely.
--
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]