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

Fix data race bug: In concurrency scenario, RegisterRuleCheckSlotForResource and Entry will compete the slots in SlotChain #337

Merged

Conversation

louyuting
Copy link
Collaborator

@louyuting louyuting commented Nov 30, 2020

Describe what this PR does / why we need it

Does this pull request fix one issue?

"Fixes #335 "
"Fixes #336 "

Describe how you did it

Describe how to verify it

run unit test

Special notes for reviews

@louyuting louyuting linked an issue Nov 30, 2020 that may be closed by this pull request
@louyuting louyuting added this to the 1.0.1 milestone Nov 30, 2020
@louyuting louyuting added the kind/bug Something isn't working label Nov 30, 2020
@louyuting louyuting force-pushed the 20201201-fix-data-race-in-AddRuleCheckSlot branch 3 times, most recently from f2b7811 to 811cacc Compare December 2, 2020 13:54
@codecov-io
Copy link

codecov-io commented Dec 2, 2020

Codecov Report

Merging #337 (811cacc) into master (365844b) will increase coverage by 0.07%.
The diff coverage is 48.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #337      +/-   ##
==========================================
+ Coverage   50.75%   50.83%   +0.07%     
==========================================
  Files          69       69              
  Lines        3822     3842      +20     
==========================================
+ Hits         1940     1953      +13     
- Misses       1614     1621       +7     
  Partials      268      268              
Impacted Files Coverage Δ
core/system/rule_manager.go 80.39% <ø> (-0.38%) ⬇️
core/misc/resource_slot_chain.go 37.68% <36.36%> (-0.06%) ⬇️
core/base/slot_chain.go 97.82% <100.00%> (+0.12%) ⬆️
core/system/slot.go 49.15% <0.00%> (-1.70%) ⬇️
core/hotspot/slot.go 27.77% <0.00%> (+2.77%) ⬆️
core/flow/slot.go 46.66% <0.00%> (+3.33%) ⬆️
core/isolation/slot.go 7.69% <0.00%> (+3.84%) ⬆️
core/circuitbreaker/slot.go 100.00% <0.00%> (+5.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 365844b...811cacc. Read the comment docs.

luckyxiaoqiang
luckyxiaoqiang previously approved these changes Dec 3, 2020
Copy link
Collaborator

@luckyxiaoqiang luckyxiaoqiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@louyuting louyuting changed the title Fix data race Bug: AddRuleCheckSlot and Entry Fix data race bug: In concurrency scenario, RegisterRuleCheckSlotForResource and Entry will compete the slots in SlotChain Dec 3, 2020
binbin0325
binbin0325 previously approved these changes Dec 3, 2020
Copy link
Collaborator

@binbin0325 binbin0325 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@louyuting louyuting force-pushed the 20201201-fix-data-race-in-AddRuleCheckSlot branch from 811cacc to fbfb398 Compare December 3, 2020 15:44
Copy link
Collaborator

@binbin0325 binbin0325 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@louyuting louyuting merged commit 2ac02ec into alibaba:master Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] System adaptive rules won't take effect due to absence of slots [BUG] Data race in AddRuleCheckSlot
4 participants