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

Optimize circuit breaking state transformation using CAS in DegradeRule #538

Merged
merged 1 commit into from
Mar 5, 2019

Conversation

ATAXGT
Copy link
Contributor

@ATAXGT ATAXGT commented Mar 4, 2019

Describe what this PR does / why we need it

I feel that the method of modifying variables by synchronization is relatively poor, so I changed to CAS

Does this pull request fix one issue?

NONE

Describe how you did it

Modify the type of the property to AtomicBoolean and use compareAndSet method to change it.

Describe how to verify it

Use DegradeTest.java to verity it

Special notes for reviews

@CLAassistant
Copy link

CLAassistant commented Mar 4, 2019

CLA assistant check
All committers have signed the CLA.

@sczyh30 sczyh30 added the to-review To review label Mar 4, 2019
@codecov-io
Copy link

codecov-io commented Mar 4, 2019

Codecov Report

Merging #538 into master will decrease coverage by 0.09%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #538     +/-   ##
===========================================
- Coverage     38.24%   38.14%   -0.1%     
+ Complexity     1115     1111      -4     
===========================================
  Files           259      259             
  Lines          8174     8171      -3     
  Branches       1113     1113             
===========================================
- Hits           3126     3117      -9     
- Misses         4641     4644      +3     
- Partials        407      410      +3
Impacted Files Coverage Δ Complexity Δ
.../csp/sentinel/slots/block/degrade/DegradeRule.java 55.55% <66.66%> (-3.97%) 17 <7> (-1)
...ava/com/alibaba/csp/sentinel/node/ClusterNode.java 95.45% <0%> (-4.55%) 7% <0%> (-1%)
...a/csp/sentinel/slots/statistic/base/LeapArray.java 69.62% <0%> (-2.54%) 25% <0%> (-1%)
...l/cluster/server/connection/ConnectionManager.java 74% <0%> (-2%) 10% <0%> (-1%)

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 b7956c6...609aa31. Read the comment docs.

@sczyh30 sczyh30 changed the title Change the way the cut attribute is modified Optimize circuit breaking state transformation using CAS in DegradeRule Mar 5, 2019
Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

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

LGTM

@sczyh30 sczyh30 merged commit 10d7c90 into alibaba:master Mar 5, 2019
@sczyh30
Copy link
Member

sczyh30 commented Mar 5, 2019

Thanks for contributing!

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

Successfully merging this pull request may close these issues.

4 participants