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 connect bug #812

Merged
merged 1 commit into from
Apr 16, 2022
Merged

fix connect bug #812

merged 1 commit into from
Apr 16, 2022

Conversation

fengjiachun
Copy link
Contributor

@fengjiachun fengjiachun commented Apr 13, 2022

Motivation:

对 Bolt 的 InvokeContext 上有误解(以为 bolt 内部只读不写,用户层写),实际上 bolt 内部也会写 ctx 来传递上下文,比如一个 rpc 调用会先记录获取连接的时间 t 到 ctx 中,再计算 rpc 超时再从 ctx 中取出来,jraft 错误的使用了 InvokeCtx,在上层不传入 ctx 时会使用一个全局的 default instance,这导致了上面那个 t 并发写入覆盖的问题,在获取连接耗时较高(第一次建连)时,t 较大占用了 rpcTimeout 的大部分,导致 rpc 调用超时

https://github.com/sofastack/sofa-bolt/blame/master/src/main/java/com/alipay/remoting/InvokeContext.java
create_conn_time 计入 rpc_timeout 时间是在 1.6.4 引入的新特性,1.6.2 没问题

Modification:

Describe the idea and modifications you've done.

Result:

Fixes #810

If there is no issue then describe the changes introduced by this PR.

@sofastack-bot sofastack-bot bot added bug Something isn't working cla:yes size/M labels Apr 13, 2022
Copy link
Member

@horizonzy horizonzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@horizonzy horizonzy merged commit 0929136 into master Apr 16, 2022
@fengjiachun fengjiachun deleted the fix_bolt_rpc_timeout branch April 18, 2022 01:05
@fengjiachun fengjiachun mentioned this pull request Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla:yes size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.3.9 jraft 下2个节点时无法选主
2 participants