lizhanhui commented on issue #521: URL: https://github.com/apache/rocketmq-clients/issues/521#issuecomment-1752008196
> A same issue #421 has been closed so I open a new one Here's the bug I found [https://github.com/apache/rocketmq-clients/issues/421#issuecomment-1562124468](url) > > > 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 You are right, the state of the ConsumeMessageServiceImpl is out of sync with lifecycle. -- 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]
