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] 并发度计算忽略了BatchCount,导致资源隔离异常 #556

Open
Levi-Hope opened this issue Jan 31, 2024 · 1 comment
Open

Comments

@Levi-Hope
Copy link

Levi-Hope commented Jan 31, 2024

Issue Description

Type: bug report

Describe what happened

并发度计算忽略了BatchCount,但资源隔离考虑了BatchCount,这样会导致资源隔离逻辑出现异常。
比如说IsolationRule阈值为10,调用4次sentinel.Entry("abc", sentinel.WithBatchCount(8)),返回结果是:
Pass
Pass
Pass
Block
在第4次Entry才会返回Block,之前的3次Entry都Pass了,通过资源24个,相当于漏限12个资源。

Describe what you expected to happen

并发度计算需要考虑BatchCount。
在上面那个例子里,第2次Entry就应该Block住。

How to reproduce it (as minimally and precisely as possible)

我在 这里 里补了一个集成测试,这个测试可以复现。

Tell us your environment

Anything else we need to know?

已提PR #557

@Levi-Hope
Copy link
Author

已提PR #557

@Levi-Hope Levi-Hope changed the title [BUG] Concurrency ignore batchCount | 并发度计算忽略了BatchCount [BUG] 并发度计算忽略了BatchCount Jan 31, 2024
@Levi-Hope Levi-Hope changed the title [BUG] 并发度计算忽略了BatchCount [BUG] 并发度计算忽略了BatchCount,导致资源隔离异常 Jan 31, 2024
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

1 participant