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

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed** | Severity: **Medium**
   
   ### Verification Summary
   
   Verified against `PopConsumerService.java` on `develop` branch. The 
described head-of-line blocking behavior is confirmed in the code.
   
   ### Root Cause Analysis
   
   Two failure paths in `revive(AtomicLong, int)` cause the entire batch to 
abort:
   
   1. **Synchronous throw (line 593-597):** When `this.revive(record)` throws 
synchronously (e.g., `getMessageAsync` completes synchronously with a throw), 
the `catch` block re-throws as `RuntimeException`, aborting the for-loop. All 
subsequent records are not processed.
   
   2. **Async exceptional completion (line 617):** `revive(PopConsumerRecord)` 
at line 552 chains `getMessageAsync(record).thenCompose(...)` with **no 
`.exceptionally()` handler**. If any future completes exceptionally, 
`CompletableFuture.allOf(...).join()` throws `CompletionException`, skipping:
      - `writeRecords(failureList)` — line 618
      - `deleteRecords(consumerRecords)` — line 619  
      - `currentTime.set(...)` — line 620
   
   This means healthy records in the same batch are never persisted as 
processed, and the batch gets stuck retrying the same failing record 
indefinitely.
   
   ### Scope
   
   Confirmed: popkv path only (`popConsumerKVServiceEnable`), disabled by 
default. Does **not** affect legacy `PopBufferMergeService`.
   
   ### Suggested Fix Direction
   
   - Add `.exceptionally()` to the per-record future in 
`revive(PopConsumerRecord)` to isolate failures
   - Wrap the per-record call in the batch loop to catch both sync and async 
failures
   - Ensure `writeRecords`, `deleteRecords`, and `currentTime` advance always 
execute even when individual records fail
   
   ---
   *Automated evaluation by github-manager-bot*


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