[ISSUE #137] split TcpRemotingClient::m_ioService into m_dispatchService and m_handleService#156
Conversation
…nt::m_dispachService.
| LOG_DEBUG("find_response opaque:%d", opaque); | ||
| processResponseCommand(pRespondCmd, pFuture); | ||
| } else { | ||
| processRequestCommand(pRespondCmd, addr); |
There was a problem hiding this comment.
i suggest continue to use processRequestCommand, put m_handleService.post() to it, it will more clear to readers
There was a problem hiding this comment.
No. Do it will write another function for call processRequest and invokeOneway, it is unnecessary.
| string taskName = UtilAll::getProcessName(); | ||
| prctl(PR_SET_NAME, "DispatchTP", 0, 0, 0); | ||
| #endif | ||
| for (int i = 0; i != m_dispatchThreadNum; ++i) { |
There was a problem hiding this comment.
i < m_dispatchThreadNum is more safety than i!= m_dispatchThreadNum, it can handle the situation when some one change the i in {]
There was a problem hiding this comment.
all codes for create threads used unequal.
There was a problem hiding this comment.
it not a good style of use unequal in for loop
| #if !defined(WIN32) && !defined(__APPLE__) | ||
| prctl(PR_SET_NAME, "NetworkTP", 0, 0, 0); | ||
| #endif | ||
| for (int i = 0; i != m_pullThreadNum; ++i) { |
| processResponseCommand(pRespondCmd, pFuture); | ||
| } else { | ||
| processRequestCommand(pRespondCmd, addr); | ||
| m_handleService.post(boost::bind(&TcpRemotingClient::processRequestCommand, this, pRespondCmd, addr)); |
There was a problem hiding this comment.
when so many rebalance request come, m_handleService also be holded, so no thread to handle the response message?
| processResponseCommand(pRespondCmd, pFuture); | ||
| } else { | ||
| processRequestCommand(pRespondCmd, addr); | ||
| m_handleService.post(boost::bind(&TcpRemotingClient::processRequestCommand, this, pRespondCmd, addr)); |
There was a problem hiding this comment.
when so many rebalance request come(consumer changed), m_handleService also be holded, so no thread to handle the response message?
There was a problem hiding this comment.
because rebalance is very quick without PullMsgEvent. we can do rebalance in an independent thread in future, after replace boost::asio with new implement. there is a RebalanceService in java, and i have written it in another branch for cpp.
What is the purpose of the change
use io-thread pool and work-thread pool in network callback to resolve deadlock in block-request.
Brief changelog
split TcpRemotingClient::m_ioService into m_dispatchService and m_handleService.
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.[ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.