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

ProviderQpsFlowControlHandler不被执行的问题 #4646

Open
klesweet opened this issue Dec 25, 2024 · 4 comments
Open

ProviderQpsFlowControlHandler不被执行的问题 #4646

klesweet opened this issue Dec 25, 2024 · 4 comments

Comments

@klesweet
Copy link

klesweet commented Dec 25, 2024

当请求走到doInvoke时
image
由于在外部进行了++,导致handlerIndex已经是1了
image
此时放在handlerList中的首个是ProviderQpsFlowControlHandler
image
它的首行会判断invocation的hanlerIndex是否大于0,由于handlerIndex++放在入口前,且handlerIndex不能赋值初始值为-1,也没有其他途径修改值,所以进来这里的代码一定是大于0的,导致ProviderQpsFlowControlHandler可能永远不被执行
image

我在走读代码的时候看到了这么个情况,绞尽脑子没有想到缘由,可能不是bug,而是有什么其他设计,希望能够得到解答,万分感谢!

@yanghao605
Copy link
Contributor

ProviderQpsFlowControlHandler在handler执行之前被调用,不依赖next方法执行

@liubao68
Copy link
Contributor

为了优化性能,做了特殊处理。

@klesweet
Copy link
Author

哦哦好的,感谢大佬们的答复;既然不依赖于next方法执行,且在于handler执行之前就已经执行,那就应该于handler这套策略逻辑无关,那为什么在设计上将它实现了handler方法呢,还望大佬指点一二,万分感谢

@liubao68
Copy link
Contributor

liubao68 commented Dec 28, 2024

哦哦好的,感谢大佬们的答复;既然不依赖于next方法执行,且在于handler执行之前就已经执行,那就应该于handler这套策略逻辑无关,那为什么在设计上将它实现了handler方法呢,还望大佬指点一二,万分感谢

历史遗留问题。 3.x已经改进。

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