apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.04k stars 3.92k forks source link

BUG? Response执行完先于IssueRPC中的bthread_id_unlock执行完毕的话, unlock会失败吧? #2646

Open jiangdongzi opened 1 month ago

jiangdongzi commented 1 month ago

在写mongo客户端, 遇到了bthread_id_unlock_and_destroy先于bthread_id_unlock执行完毕的情况, 导致unlock失败

image 这句可能会在bthread_id_unlock_and_destroy之前执行完毕, 那么check会失败

chenBright commented 1 month ago

bthread_id_unlock的返回值是什么?

jiangdongzi commented 1 month ago

bthread_id_unlock的返回值是什么?

22

chenBright commented 1 month ago

发rpc的时候,已经lock bthread_id了,bthread_id_unlock_and_destroy实际是在bthread_id_unlock里被调的,这在设计的时候已经考虑到了。

bthread_id的使用是不是有改动?或者定位一下这个EINVAL返回值实际是哪里返回的。