sentinel-golang
sentinel-golang copied to clipboard
fix concurrency isolation control bug
Describe what this PR does / why we need it
Does this pull request fix one issue?
Fixes #394
Describe how you did it
In the previous version, for the "concurrency" field of the "BaseStatNode" struct , reading and writing here are not at the same time. Will miss a certain number of concurrency statistics, I added a "preConcurrency" field, It is used to record these unrecorded concurrent numbers.
At the "execute rule based checking slot", Only when read "concurrency", will Increase the "preConcurrency"
At the "execute statistic slot", try to Decrease the "preConcurrency"
Describe how to verify it
I added the unit test mentioned before and it can now pass.
Special notes for reviews
I don't think so.
Hi, thanks for contributing. Could you please sign the CLA here? And please make sure the email of your commits match your GitHub email. You may refer to the instruction here, or rebase your commits with the correct email.
感谢贡献,请将 commit 对应的 email 调整成与 GitHub 的 email 相匹配并 确认一下 CLA。
@luckyxiaoqiang could you please take a look?