ustcr7 commented on issue #211: GetTransport of:x.x.x.x:yyyy get timed_mutex 
timeout
URL: 
https://github.com/apache/rocketmq-client-cpp/issues/211#issuecomment-573565121
 
 
   > 这里的问题比较奇怪,在 CloseTransport 过程会对 TcpRemotingClient::m_tcpTableLock 加锁,然后调用 
TcpTransport::disconnect -> TcpTransport::freeBufferEvent 通过操作 bufferevent 进入 
libevent,最终是锁在了 libevent 里面。所以才有一系列的 timed_mutex timeout。要解决这个问题,需要先定位为什么会锁在 
libevent 里。
   
   其实就是libevent在高并发情况下,关闭连接时的bug。下面几个链接有说明。
   https://archives.seul.org/libevent/users/Aug-2012/msg00010.html  
   
   https://github.com/libevent/libevent/issues/225  
   
   https://archives.seul.org/libevent/users/Apr-2013/msg00002.html  
   
   我根据代码和链接里面的解释大概画了个图:
   
![image](https://user-images.githubusercontent.com/5212409/72243123-07753380-3626-11ea-8159-54a83dfa08f5.png)
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to