RockteMQ-AI commented on issue #10696: URL: https://github.com/apache/rocketmq/issues/10696#issuecomment-5130581812
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** The reported issue has been verified against the current codebase at commit `00e45b8`. **Root Cause:** The three async `request()` overloads in `DefaultMQProducerImpl.java` (lines ~1659, ~1720, ~1790) call `RequestFutureHolder.getInstance().getRequestFutureTable().put(correlationId, requestResponseFuture)` before invoking the send method, but have no `try/finally` or `catch` block to remove the future if the send throws synchronously. The synchronous overloads (lines ~1629, ~1689, ~1746) correctly handle this with a `finally` block. **Impact:** When send initiation fails synchronously (e.g., no route, selector throws), the stale future remains in `requestFutureTable` until the timeout sweep in `RequestFutureHolder.scanExpiredRequest()`. This leaks memory and can deliver a spurious `RequestTimeoutException` callback after the caller has already observed the synchronous exception. **Severity:** medium — resource leak and potential spurious callback, but does not cause data loss or crash. **Affected file:** `client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java` An automated fix proposal will be generated. Reply `/approve` to proceed with PR generation. --- *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]
