-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRule.java
Outdated
Show resolved
Hide resolved
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRule.java
Outdated
Show resolved
Hide resolved
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRule.java
Outdated
Show resolved
Hide resolved
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRule.java
Outdated
Show resolved
Hide resolved
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRule.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for contributing! |
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