RockteMQ-AI commented on issue #10985:
URL: https://github.com/apache/rocketmq/issues/10985#issuecomment-5460960161

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed** | Severity: **High**
   
   The reported issue has been verified against the current codebase on branch 
`develop`.
   
   **Root Cause:**
   In `PopReviveService.reviveMsgFromCk()` (line ~586), when 
`EscapeBridge.getMessageAsync()` completes exceptionally, the resulting 
`CompletableFuture` propagates the exception through `.thenApply()`. Inside the 
`allOf().whenComplete()` callback, `future.getNow(new Pair<>(0L, false))` 
throws `CompletionException` for the failed future, causing the callback to 
exit before:
   - calling `rePutCK()` to preserve retryability
   - marking the in-flight checkpoint complete
   - removing it from `inflightReviveRequestMap`
   
   Meanwhile, `mergeAndRevive()` has already advanced and committed the revive 
offset past this checkpoint (line ~543-548). With 1-3 failed checkpoints and 
low traffic, the size-gated timeout (`inflightReviveRequestMap.size() > 3`) is 
never entered, so the unacknowledged message is never redelivered.
   
   **Impact:** Violates POP's at-least-once redelivery guarantee. Affected 
component: `broker/PopReviveService`.
   
   **Suggested Fix:**
   As the reporter suggests, use `CompletableFuture.handle` (or 
`exceptionally`) on the `getBizMessage` stage to catch exceptional completions 
and route them to the existing `rePutCK` path, keeping the handler scoped to 
the read stage.
   
   An automated fix proposal may 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]

Reply via email to