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

Nacos 2.3.0 反脆弱插件NacosConnectionControlManager类判断条件存在问题 #11624

Closed
Happy-26 opened this issue Jan 10, 2024 · 1 comment
Labels

Comments

@Happy-26
Copy link
Contributor

totalCountLimit 是 配置文件里设置的最大连接数,totalCount是现在已经注册到nacos的服务实例数量。

这里的判断应该修改为 if (totalCount >= totalCountLimit) ,否则会导致多注册一个实例。

image

@KomachiSion
Copy link
Collaborator

我认为多一个问题应该不大, 而且默认插件使用的是固定秒的统计方式, 如果同一秒有多个连接同时连接, 且超过限流值, 会超过限流值不止1个, 不过下一秒就会被拒绝。

就像插件文档里说的, 如果对精确度有更高要求, 可以使用滑动窗口等统计方式实现。

这里如果期望改成大于等于可以的。欢迎提交pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants