lizhimins commented on PR #11380: URL: https://github.com/apache/rocketmq/pull/11380#issuecomment-7152182434
The null guards and the buffer-release fix are valid hardening — the leak on the failed consume-queue append path is real. But the underlying scenario is fundamentally hard to solve: once the local expiry sweep deletes CQ/commitlog data that the dispatcher has not yet consumed, those messages are unrecoverable, and no handling inside the dispatch loop can bring them back. Concretely, with this patch a mid-batch null breaks the batch and commits the partial prefix; the next round then hits the existing preflight null check at the same offset and returns false — the NPE becomes a clean, permanent stall at the gap. Skipping the gap instead would silently drop messages from the tiered store, which is worse. The real fix lives outside this loop: either coordinate local retention with dispatch progress (do not expire data that has not been tiered), or explicitly surface the gap as data loss. Both are design-level changes, not something a guard clause can resolve. Fine to land as crash prevention + leak fix, but it should not be mistaken for a solution to dispatching over expired/corrupted local data. Note: #10999 has landed in the same loop; this branch needs a rebase. -- 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]
