You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "chaojizhuoge (via GitHub)" <gi...@apache.org> on 2023/05/25 01:12:06 UTC

[GitHub] [rocketmq-clients] chaojizhuoge commented on issue #421: cpp client crashed

chaojizhuoge commented on issue #421:
URL: https://github.com/apache/rocketmq-clients/issues/421#issuecomment-1562124468

   Here's the problem:
   `void ConsumeMessageServiceImpl::shutdown() {
     State expected = State::STOPPING;
     if (state_.compare_exchange_strong(expected, State::STOPPED, std::memory_order_relaxed)) {
       pool_->shutdown();
     }
   }`
   There's no STOPPING state for ConsumeMessageServiceImpl, so the `pool_->shutdown();` will never be executed.
   Threads inside pool_ would be joinable when dtor, which causes the std::terminate.
   `State expected = State::STARTING;` will fix this


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org