线程限制产生竞态条件的一种规避方式
Describe what this PR does / why we need it
详细描述见: https://github.com/alibaba/Sentinel/issues/59 一种解决方案:使用信号量+ThreadLocal的方式,保证了原子性,也保证了能在接下来的Slot的处理过程中能利用到前面的结果。
该方式加强了线程限制的准确性,并保持原有的逻辑不变。
Does this pull request fix one issue?
Describe how you did it
Describe how to verify it
Special notes for reviews
Codecov Report
:exclamation: No coverage uploaded for pull request base (
master@9c268bd). Click here to learn what that means. The diff coverage isn/a.
@@ Coverage Diff @@
## master #76 +/- ##
=========================================
Coverage ? 40.43%
Complexity ? 1314
=========================================
Files ? 297
Lines ? 8591
Branches ? 1156
=========================================
Hits ? 3474
Misses ? 4693
Partials ? 424
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 9c268bd...5f9f120. Read the comment docs.
ping @manzhizhen Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
OK, I will deal with it later.
ping @manzhizhen Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
Already submitted, in integration testing
ping @manzhizhen Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
ok,I do it later.
ping @manzhizhen Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
I do it now!!
Ping @manzhizhen . Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
Ping @manzhizhen . Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
Ping @manzhizhen . Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
Ping @manzhizhen . Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
Ping @manzhizhen . Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
Ping @manzhizhen . Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
ping @manzhizhen Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
ok,I do it.
ping @manzhizhen Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
ok!!
ping @manzhizhen Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
ok
ping @manzhizhen Conflict happens after merging a previous commit. Please rebase the branch against master and push it back again. Thanks a lot.
ok,I will do it
Codecov Report
Merging #76 into master will decrease coverage by
1.31%. The diff coverage isn/a.
@@ Coverage Diff @@
## master #76 +/- ##
============================================
- Coverage 41.75% 40.43% -1.32%
+ Complexity 1377 1314 -63
============================================
Files 304 297 -7
Lines 8766 8591 -175
Branches 1182 1156 -26
============================================
- Hits 3660 3474 -186
- Misses 4660 4693 +33
+ Partials 446 424 -22
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update ee38587...5f9f120. Read the comment docs.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
yizhenqiang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.
The PR has remained open for an extended period and has accumulated significant merge conflicts. We will therefore close it temporarily as the main development branch for Sentinel has now transitioned to the 1.8 branch. New contributions are welcome with PRs based on the 1.8 branch.