Skip to content
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

[bug] 最后一个request会hang住或者超时 #97

Closed
qinzuoyan opened this issue Jun 7, 2016 · 2 comments
Closed

[bug] 最后一个request会hang住或者超时 #97

qinzuoyan opened this issue Jun 7, 2016 · 2 comments

Comments

@qinzuoyan
Copy link
Collaborator

在使用sofa-pbrpc时发现server有时候会不响应client发出去的最后一个请求,打出function trace后发现是如下场景:

  1. rpc_server_message_stream::on_write_some,释放send token并触发try_start_send。
  2. try_start_send里获取send token成功,get_from_pending_queue从queue中拿pending response。
  3. 此时,async_send_message开始,put_into_pending_queue完成,触发try_start_send,获取send token失败,try_start_send直接完成。
  4. 步骤2中的get_from_pending_queue并不一定能拿到步骤3中入queue的response,当拿不到时,步骤2触发的try_start_send也不做任何动作,完成。
  5. 此时,pending_queue中的response永远没有机会被发送,直到下一次该connection需要发送response。

发现1.1.0和master上都有该问题,该问题的影响是,如果客户端的逻辑是blocking的(使用 blocking接口或者必须等待上一个request的response才会触发下一次rpc),最后一个request会hang住或者超时。

多谢 Xi Liu(sudo.nju04@gmail.com)报告该问题。

qinzuoyan added a commit to qinzuoyan/sofa-pbrpc that referenced this issue Jun 7, 2016
qinzuoyan added a commit that referenced this issue Jun 7, 2016
fix bug #97, which may cause pending message not sent immediately
@bluebore
Copy link
Collaborator

bluebore commented Jun 7, 2016

提到master存在的问题,不知道@qinzuoyan 是否见过 #80 这个
频繁复现,但一直没定位,master分支已经没法用了

@qinzuoyan
Copy link
Collaborator Author

还真没有遇到过,从那个commit开始有这个问题的?

@cyshi cyshi closed this as completed Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants