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

   Hi @Aias00, thanks for reporting this!
   
   I've analyzed this issue against the codebase and can confirm this appears 
to be a **real bug**.
   
   **Root Cause:** In EscapeBridge.decodeMsgList, line 358 calls 
`getMessageResult.getMessageQueueOffset().get(i)` without checking whether the 
queue-offset list has an entry for the current message. When messages are added 
to GetMessageResult via addMessage() without a queue offset, messageQueueOffset 
remains shorter than messageBufferList, causing IndexOutOfBoundsException.
   **Affected Files:** 
broker/src/main/java/org/apache/rocketmq/broker/failover/EscapeBridge.java, 
store/src/main/java/org/apache/rocketmq/store/GetMessageResult.java
   
   **Analysis:** A valid GetMessageResult can contain decoded message buffers 
while its optional messageQueueOffset metadata is empty or incomplete. The 
current code assumes the two lists are always the same length, so the offset 
lookup should be guarded and the decoded message offset used only when a CQ 
offset exists.
   
   I'll prepare a fix spec and work on a PR. The community is welcome to 
provide feedback on the approach before implementation.
   
   ---
   🤖 *Automated issue analysis by github-manager*


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