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

   **Issue Evaluation (Updated)**
   
   Category: `bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase.
   
   **Root Cause:** cpp/source/rocketmq/ConsumeTask.cpp:138 - 
`ConsumeTask::process()` locks the consumer weak_ptr without a null check and 
dereferences it; when the application drops the last shared_ptr while a task is 
running, the destructor runs on the consume worker thread, logs, then shuts 
down the thread pool, self-joining and terminating.
   **Evidence:** Public `PushConsumer` has no `shutdown()`/`close()` API 
(cpp/include/rocketmq/PushConsumer.h:36-52). `ConsumeTask::process()` locks 
`svc->consumer()` at line 138 and uses `consumer->...` without null checks 
(lines 152-153, 162-169). `PushConsumerImpl::~PushConsumerImpl()` logs at line 
45 before calling `shutdown()` at line 46; `shutdown()` is `noexcept` (line 
112) and calls `ConsumeMessageServiceImpl::shutdown()`, which joins the thread 
pool unconditionally (cpp/source/base/ThreadPoolImpl.cpp:82-86). If the 
destructor runs on a pool worker, this self-join raises `EDEADLK` and 
terminates. `ClientManagerImpl` stores clients as weak_ptrs 
(cpp/source/client/include/ClientManagerImpl.h:216), confirming the application 
reference is the only strong owner.
   
   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]

Reply via email to