RockteMQ-AI commented on issue #10754: URL: https://github.com/apache/rocketmq/issues/10754#issuecomment-5158444694
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** The reported issue has been verified against the current codebase at `a06836d`. **Root Cause:** `LmqPullRequestHoldService.checkHoldRequest()` has a TOCTOU race between the `isEmpty()` check and `pullRequestTable.remove(key)`. After `notifyMessageArriving` drains the bucket via `cloneListAndClear()`, a concurrent `suspendPullRequest` can insert a new request into the same bucket. The subsequent `remove(key)` then silently drops the newly inserted request. Additionally, `getPullRequestList().isEmpty()` is called without synchronization on the raw `ArrayList`, creating a data race. **Impact:** Pull requests can be silently lost during concurrent LMQ consumption, leading to message delivery delays or stalls for affected queues. **Severity:** High — silent request loss directly affects message delivery reliability. **Suggested fix direction:** Use `pullRequestTable.remove(key, mpr)` (conditional remove) to ensure only the same `mpr` instance is removed, or synchronize the isEmpty+remove sequence. An automated fix proposal can 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]
