-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
是否可以直接执行Socket::StartWrite里的KeepWrite? #2588
Comments
如果直接在当前bthread执行KeepWrite,可能会阻塞异步rpc的CallMethod调用。 |
这样也会影响服务端异步rpc响应吧。Socket::StartWrite里直接调用KeepWrite,会导致Write阻塞,不太合理吧。 加个参数,支持使用bthread_start_urgent原地执行KeepWrite,应该能满足需求。 |
当前请求的response已经返回了,client端应该是已经结束了。Write阻塞指的是什么? |
单纯从Socket::Write接口看就是有可能会阻塞吧。 |
只有baidu_rpc_protocol.cpp SendRpcResponse调用Socket::Write的时候才会在执行完之后去处理队列里的消息,默认都是使用bthread_start_background |
用bthread_start_urgent效果差不多,但是影响更小? |
效果应该差不多 |
@xybanpeng 可以使用 #2591 测试一下优化效果 |
Socket::StartWrite里的KeepWrite,是不是可以直接调用,不需要起后台bthread。当前session的response已经返回了,直接用当前bthread执行排队的response就可以,不然在压力比较大的时候等其他worker去执行这个bthead,延迟会增加很多
The text was updated successfully, but these errors were encountered: