zgaze commented on issue #2313:
URL: https://github.com/apache/brpc/issues/2313#issuecomment-1632324368

   > > 
   > 
   > 你的场景大概是: 
本身是一个brpc服务,然后调用tf的,而tf里面有部分op是请求下游的rpc服务?这个场景的核心问题就是DirectSession::Run会使用pthread同步机制,阻塞当前的pthread。导致bthread的worker线程被卡住,bthread无法切换走。qps一高,就有可能导致bthread的线程池全部被占用,但是TF的RPC
 Op还等着处理,就导致死锁了。感觉可以这样解决: 
新建一个pthread线程池,将session::run丢到这个新建的线程池处理(当然使用异步的方式)。这样就不会导致bthread 
worker线程卡死的问题了。
   
   非常感谢。 这个思路我之前有,但是不确定能不能解决这个问题。 
   这个问题我关闭,感谢几位的热情支持 。另外,我觉得brpc可以提供一个utils类,来支撑这样的场景。感觉还是挺常见的。


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to