chongg039 commented on issue #2453: URL: https://github.com/apache/brpc/issues/2453#issuecomment-1825342859
> > @sinomiko @FancyJan 这两个场景都不是。后来调查了一下,现场是一个8核的vm,就开了9个pthread worker。我们的程序后台有一些bthread task,有的地方还混用了pthread lock的逻辑,猜测应该是哪里的代码有点问题,没有worker来干活了。通过调大pthread数,或者关闭那些后台的task,都不会再次出现。准备详细调查一下相关的代码实现,看看是不是写挫了。 > > 我好像也碰到过这种,在bthread上使用pthread锁可能会有问题:例如一个读写锁的场景,写线程持有锁被切换到后台,此时所有的worker如果刚好都在读同一把锁被阻塞,就没有worker去释放写锁了。 可以试一下换成bthread::Mutex,或者开启--usercode_in_pthread=true看看还会不会卡住。 是的,其实我们之前出现过好几个类似的问题,但是由于确实对bthread了解的不够深,这次在网卡上没收到包的时候其实压根没往这里想,还是心血来潮尝试调大一下worker数才发现的。后来看了下其实文档里面已经提到过了:  这个场景恰好比较特殊,只有8个核,其他线上的机器核数都比较多,恰好没出现过此类问题。 -- 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org