RockteMQ-AI commented on issue #1335: URL: https://github.com/apache/rocketmq-clients/issues/1335#issuecomment-5277773358
**Issue Evaluation (Updated)** Category: `bug` | Status: **Confirmed** The reported issue has been verified against the current codebase. **Root Cause:** Multiple locations — (1) `cpp/source/client/include/ClientManager.h:97-100`: `send()` is the only RPC method without a `std::chrono::milliseconds timeout` parameter; (2) `cpp/source/client/ClientManagerImpl.cpp:288-487`: `send()` never calls `set_deadline()` on the gRPC context, so SendMessage RPCs have no transport-level deadline; (3) `cpp/source/rocketmq/ProducerImpl.cpp:252`: sync `send()` uses `cv->Wait()` without deadline; (4) `ProducerImpl.cpp:463-466`: `endTransaction0()` calls `cv->Wait()` without checking the `completed` flag — lost wakeup; (5) `ProducerImpl.cpp:579-582`: `recallMessage()` calls `cv->Wait()` with no completion flag at all — lost wakeup; (6) `ProducerImpl.cpp:641-644`: `getPublishInfo()` reads `complete` outside the mutex then locks and waits — TOCTOU race causing permanent hang. **Evidence:** Every claim in the issue is verified by the source code. The `ClientManager` interface (lines 58-104) shows all RPCs accept `std::chrono::milliseconds timeout` except `send()` (line 97). `ClientManagerImpl::send()` (line 288) has no `set_deadline()` call, unlike all other RPCs (e.g., `ack()` at line 1014, `endTransaction()` at line 1238, `recallMessage()` at line 1349). In `ProducerImpl.cpp`, the sync `send()` wait at line 252 has a correct `if (!completed)` guard but no deadline. `endTransaction0()` at line 465 and `recallMessage()` at line 581 unconditionally call `cv->Wait()` without checking a completion flag, making them vulnerable to lost wakeups. `getPublishInfo()` at line 641 reads `complete` without holding the mutex, creating the exact TOCTOU race described in the issue. `requestTimeout()` is only used in `endTransaction` (line 461) and `recallMessage` (line 577), never for the normal `send()` path. An automated fix proposal will 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]
