RockteMQ-AI commented on issue #11047:
URL: https://github.com/apache/rocketmq/issues/11047#issuecomment-5556528129
**Issue Evaluation**
Category: `bug` | Status: **Confirmed**
Verified against
`TimerMessageStore.TimerEnqueuePutService#fetchAndPutTimerRequest` in
`store/src/main/java/org/apache/rocketmq/store/timer/TimerMessageStore.java`.
The retry loop iterates **all** requests in `trs` and calls
`putMessageToTimerWheel(req)` without checking `TimerRequest#isSucc`:
```java
while (!isStopped()) {
// ... processes ALL requests in trs ...
boolean allSuccess = trs.stream().allMatch(TimerRequest::isSucc);
if (allSuccess) break;
else holdMomentForUnknownError();
// retries ALL, including already-succeeded ones
}
```
**Root Cause:** When any request in the batch fails, the entire batch is
retried. Already-succeeded requests (`isSucc == true`) are re-processed by
`putMessageToTimerWheel`, which calls `doEnqueue` again, inserting duplicate
entries into the timer wheel.
**Impact:** High — Scheduled/timer messages may be delivered multiple times
when any single request in a batch fails.
**Severity:** High — message duplication for timer/scheduled messages.
**Fix direction:** Add a guard at the top of the retry loop: `if
(req.isSucc()) continue;` to skip already-succeeded requests during retry.
An automated fix proposal will be generated. Reply `/approve` to proceed
with PR generation.
---
*Automated evaluation by RockteMQ-AI*
--
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]