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

fix issue 19--异步超时的生效问题 #20

Merged
merged 1 commit into from
Jun 10, 2019

Conversation

walkertest
Copy link
Contributor

@walkertest walkertest commented May 27, 2019

fix issue 19:#19

  • 原因:之前版本检测异步是否超时是通过轮询遍历请求(500ms)来实现,如果超时时间小于500ms,这种方式是检测不出来的;

  • 修复:每个请求添加一个定时器,定时触发超时逻辑,如果正常收包,那么cancel掉超时任务.

@walkertest walkertest changed the title fix issue 4--异步超时的生效问题 fix issue 19--异步超时的生效问题 May 27, 2019
@walkertest
Copy link
Contributor Author

@loveyacper
大佬,麻烦帮忙review一下呗

@loveyacper
Copy link

如果觉得目前精度太糙,可以调整小一些;每个请求用一个定时器应该是有性能损耗的,不如轮询增量检测。

@walkertest
Copy link
Contributor Author

walkertest commented May 28, 2019

如果觉得目前精度太糙,可以调整小一些;每个请求用一个定时器应该是有性能损耗的,不如轮询增量检测。

嗯,目前的精度太糙,我试过调成10ms之类的,但是有些场景,轮询方式,没办法做到准确的.

我们之前团队的rpc框架是用这种定时器来检测超时的(sng那边的jungle框架)

我搜了下dubbo的处理方式,也是用的这种方式,可以参考:https://github.com/apache/dubbo/blob/master/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java

这里可以用时间轮来优化下定时器.

@KahnCheny KahnCheny merged commit a7108fd into TarsCloud:master Jun 10, 2019
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

Successfully merging this pull request may close these issues.

3 participants