RockteMQ-AI commented on issue #1307:
URL: 
https://github.com/apache/rocketmq-clients/issues/1307#issuecomment-5055950598

   **Issue Evaluation**
   
   Category: `type/enhancement` | Status: **Evaluated**
   
   **Feasibility:** Feasible
   **Scope:** C++ client — `PushConsumerImpl`, `ThreadPool`, 
`ConsumeMessageService`, `ProcessQueueImpl`
   **Compatibility:** No breaking changes — purely internal shutdown reordering
   
   The proposal is well-structured and the motivation is clear. The Java 
counterpart ([#992](https://github.com/apache/rocketmq-clients/pull/992)) was 
merged on 2025-05-20, confirming the pattern is proven. The two problems 
identified — **latency spike from dropped cached messages** and **duplicate 
consumption from ack failures during teardown** — are real and worth fixing in 
the C++ SDK.
   
   The proposed 6-phase shutdown sequence maps cleanly to the C++/Asio 
execution model. A few notes:
   
   1. **`inflight_receive_requests_` tracking** — make sure the decrement 
happens in both the success and error callbacks of `receiveMessage()`, 
including timeout/cancellation paths, to avoid the counter getting stuck.
   2. **`gracefulShutdown()` vs `shutdown()`** — consider adding a timeout 
parameter so callers can fall back to force-shutdown if drain takes too long.
   3. **`awaitCachedMessagesDrained()`** — the poll interval should be 
configurable or at least documented, since it directly affects shutdown latency.
   
   A PR from the issue author would be welcome. The proposal is detailed enough 
to serve as a design doc.
   
   ---
   *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]

Reply via email to